{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Riskfolio-Lib Tutorial: \n",
    "<br>__[Financionerioncios](https://financioneroncios.wordpress.com)__\n",
    "<br>__[Orenji](https://www.orenj-i.net)__\n",
    "<br>__[Riskfolio-Lib](https://riskfolio-lib.readthedocs.io/en/latest/)__\n",
    "<br>__[Dany Cajas](https://www.linkedin.com/in/dany-cajas/)__\n",
    "<a href='https://ko-fi.com/B0B833SXD' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://cdn.ko-fi.com/cdn/kofi1.png?v=2' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a> \n",
    "\n",
    "## Tutorial 20: Black Litterman with Factors Models Mean Risk Optimization\n",
    "\n",
    "## 1. Downloading the data:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<style  type=\"text/css\" >\n",
       "</style><table id=\"T_8f2d7_\" ><thead>    <tr>        <th class=\"blank level0\" ></th>        <th class=\"col_heading level0 col0\" >0</th>        <th class=\"col_heading level0 col1\" >90</th>        <th class=\"col_heading level0 col2\" >180</th>        <th class=\"col_heading level0 col3\" >360</th>        <th class=\"col_heading level0 col4\" >720</th>        <th class=\"col_heading level0 col5\" >1800</th>        <th class=\"col_heading level0 col6\" >3600</th>        <th class=\"col_heading level0 col7\" >7200</th>        <th class=\"col_heading level0 col8\" >10800</th>    </tr>    <tr>        <th class=\"index_name level0\" >Date</th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>    </tr></thead><tbody>\n",
       "                <tr>\n",
       "                        <th id=\"T_8f2d7_level0_row0\" class=\"row_heading level0 row0\" >2017-11-16 00:00:00</th>\n",
       "                        <td id=\"T_8f2d7_row0_col0\" class=\"data row0 col0\" >0.0000%</td>\n",
       "                        <td id=\"T_8f2d7_row0_col1\" class=\"data row0 col1\" >0.0059%</td>\n",
       "                        <td id=\"T_8f2d7_row0_col2\" class=\"data row0 col2\" >0.0108%</td>\n",
       "                        <td id=\"T_8f2d7_row0_col3\" class=\"data row0 col3\" >0.0178%</td>\n",
       "                        <td id=\"T_8f2d7_row0_col4\" class=\"data row0 col4\" >0.0246%</td>\n",
       "                        <td id=\"T_8f2d7_row0_col5\" class=\"data row0 col5\" >0.0213%</td>\n",
       "                        <td id=\"T_8f2d7_row0_col6\" class=\"data row0 col6\" >0.0075%</td>\n",
       "                        <td id=\"T_8f2d7_row0_col7\" class=\"data row0 col7\" >-0.0048%</td>\n",
       "                        <td id=\"T_8f2d7_row0_col8\" class=\"data row0 col8\" >-0.0093%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_8f2d7_level0_row1\" class=\"row_heading level0 row1\" >2017-11-15 00:00:00</th>\n",
       "                        <td id=\"T_8f2d7_row1_col0\" class=\"data row1 col0\" >0.0180%</td>\n",
       "                        <td id=\"T_8f2d7_row1_col1\" class=\"data row1 col1\" >0.0247%</td>\n",
       "                        <td id=\"T_8f2d7_row1_col2\" class=\"data row1 col2\" >0.0303%</td>\n",
       "                        <td id=\"T_8f2d7_row1_col3\" class=\"data row1 col3\" >0.0391%</td>\n",
       "                        <td id=\"T_8f2d7_row1_col4\" class=\"data row1 col4\" >0.0495%</td>\n",
       "                        <td id=\"T_8f2d7_row1_col5\" class=\"data row1 col5\" >0.0558%</td>\n",
       "                        <td id=\"T_8f2d7_row1_col6\" class=\"data row1 col6\" >0.0512%</td>\n",
       "                        <td id=\"T_8f2d7_row1_col7\" class=\"data row1 col7\" >0.0450%</td>\n",
       "                        <td id=\"T_8f2d7_row1_col8\" class=\"data row1 col8\" >0.0417%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_8f2d7_level0_row2\" class=\"row_heading level0 row2\" >2017-11-14 00:00:00</th>\n",
       "                        <td id=\"T_8f2d7_row2_col0\" class=\"data row2 col0\" >-0.1800%</td>\n",
       "                        <td id=\"T_8f2d7_row2_col1\" class=\"data row2 col1\" >-0.1710%</td>\n",
       "                        <td id=\"T_8f2d7_row2_col2\" class=\"data row2 col2\" >-0.1624%</td>\n",
       "                        <td id=\"T_8f2d7_row2_col3\" class=\"data row2 col3\" >-0.1460%</td>\n",
       "                        <td id=\"T_8f2d7_row2_col4\" class=\"data row2 col4\" >-0.1167%</td>\n",
       "                        <td id=\"T_8f2d7_row2_col5\" class=\"data row2 col5\" >-0.0506%</td>\n",
       "                        <td id=\"T_8f2d7_row2_col6\" class=\"data row2 col6\" >0.0140%</td>\n",
       "                        <td id=\"T_8f2d7_row2_col7\" class=\"data row2 col7\" >0.0676%</td>\n",
       "                        <td id=\"T_8f2d7_row2_col8\" class=\"data row2 col8\" >0.0861%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_8f2d7_level0_row3\" class=\"row_heading level0 row3\" >2017-11-13 00:00:00</th>\n",
       "                        <td id=\"T_8f2d7_row3_col0\" class=\"data row3 col0\" >0.0000%</td>\n",
       "                        <td id=\"T_8f2d7_row3_col1\" class=\"data row3 col1\" >0.0013%</td>\n",
       "                        <td id=\"T_8f2d7_row3_col2\" class=\"data row3 col2\" >0.0025%</td>\n",
       "                        <td id=\"T_8f2d7_row3_col3\" class=\"data row3 col3\" >0.0048%</td>\n",
       "                        <td id=\"T_8f2d7_row3_col4\" class=\"data row3 col4\" >0.0088%</td>\n",
       "                        <td id=\"T_8f2d7_row3_col5\" class=\"data row3 col5\" >0.0174%</td>\n",
       "                        <td id=\"T_8f2d7_row3_col6\" class=\"data row3 col6\" >0.0258%</td>\n",
       "                        <td id=\"T_8f2d7_row3_col7\" class=\"data row3 col7\" >0.0334%</td>\n",
       "                        <td id=\"T_8f2d7_row3_col8\" class=\"data row3 col8\" >0.0364%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_8f2d7_level0_row4\" class=\"row_heading level0 row4\" >2017-11-10 00:00:00</th>\n",
       "                        <td id=\"T_8f2d7_row4_col0\" class=\"data row4 col0\" >0.0000%</td>\n",
       "                        <td id=\"T_8f2d7_row4_col1\" class=\"data row4 col1\" >0.0026%</td>\n",
       "                        <td id=\"T_8f2d7_row4_col2\" class=\"data row4 col2\" >0.0043%</td>\n",
       "                        <td id=\"T_8f2d7_row4_col3\" class=\"data row4 col3\" >0.0054%</td>\n",
       "                        <td id=\"T_8f2d7_row4_col4\" class=\"data row4 col4\" >0.0017%</td>\n",
       "                        <td id=\"T_8f2d7_row4_col5\" class=\"data row4 col5\" >-0.0248%</td>\n",
       "                        <td id=\"T_8f2d7_row4_col6\" class=\"data row4 col6\" >-0.0615%</td>\n",
       "                        <td id=\"T_8f2d7_row4_col7\" class=\"data row4 col7\" >-0.0936%</td>\n",
       "                        <td id=\"T_8f2d7_row4_col8\" class=\"data row4 col8\" >-0.1054%</td>\n",
       "            </tr>\n",
       "    </tbody></table>"
      ],
      "text/plain": [
       "<pandas.io.formats.style.Styler at 0x7f8d09473d00>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<style  type=\"text/css\" >\n",
       "</style><table id=\"T_b6579_\" ><thead>    <tr>        <th class=\"blank level0\" ></th>        <th class=\"col_heading level0 col0\" >APA</th>        <th class=\"col_heading level0 col1\" >CMCSA</th>        <th class=\"col_heading level0 col2\" >CNP</th>        <th class=\"col_heading level0 col3\" >HPQ</th>        <th class=\"col_heading level0 col4\" >PSA</th>        <th class=\"col_heading level0 col5\" >SEE</th>        <th class=\"col_heading level0 col6\" >ZION</th>        <th class=\"col_heading level0 col7\" >PEP11900D031</th>        <th class=\"col_heading level0 col8\" >PEP13000D012</th>        <th class=\"col_heading level0 col9\" >PEP13000M088</th>        <th class=\"col_heading level0 col10\" >PEP23900M103</th>        <th class=\"col_heading level0 col11\" >PEP70101M530</th>        <th class=\"col_heading level0 col12\" >PEP70101M571</th>        <th class=\"col_heading level0 col13\" >PEP70310M156</th>    </tr>    <tr>        <th class=\"index_name level0\" >Date</th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>    </tr></thead><tbody>\n",
       "                <tr>\n",
       "                        <th id=\"T_b6579_level0_row0\" class=\"row_heading level0 row0\" >2017-11-16 00:00:00</th>\n",
       "                        <td id=\"T_b6579_row0_col0\" class=\"data row0 col0\" >-1.3161%</td>\n",
       "                        <td id=\"T_b6579_row0_col1\" class=\"data row0 col1\" >-0.2958%</td>\n",
       "                        <td id=\"T_b6579_row0_col2\" class=\"data row0 col2\" >-1.0903%</td>\n",
       "                        <td id=\"T_b6579_row0_col3\" class=\"data row0 col3\" >0.9831%</td>\n",
       "                        <td id=\"T_b6579_row0_col4\" class=\"data row0 col4\" >1.7234%</td>\n",
       "                        <td id=\"T_b6579_row0_col5\" class=\"data row0 col5\" >1.4016%</td>\n",
       "                        <td id=\"T_b6579_row0_col6\" class=\"data row0 col6\" >-0.8387%</td>\n",
       "                        <td id=\"T_b6579_row0_col7\" class=\"data row0 col7\" >-0.0411%</td>\n",
       "                        <td id=\"T_b6579_row0_col8\" class=\"data row0 col8\" >-0.0380%</td>\n",
       "                        <td id=\"T_b6579_row0_col9\" class=\"data row0 col9\" >-0.0597%</td>\n",
       "                        <td id=\"T_b6579_row0_col10\" class=\"data row0 col10\" >-0.0737%</td>\n",
       "                        <td id=\"T_b6579_row0_col11\" class=\"data row0 col11\" >-0.0116%</td>\n",
       "                        <td id=\"T_b6579_row0_col12\" class=\"data row0 col12\" >0.0076%</td>\n",
       "                        <td id=\"T_b6579_row0_col13\" class=\"data row0 col13\" >-0.0633%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_b6579_level0_row1\" class=\"row_heading level0 row1\" >2017-11-15 00:00:00</th>\n",
       "                        <td id=\"T_b6579_row1_col0\" class=\"data row1 col0\" >-2.0296%</td>\n",
       "                        <td id=\"T_b6579_row1_col1\" class=\"data row1 col1\" >0.8682%</td>\n",
       "                        <td id=\"T_b6579_row1_col2\" class=\"data row1 col2\" >-1.1202%</td>\n",
       "                        <td id=\"T_b6579_row1_col3\" class=\"data row1 col3\" >0.0000%</td>\n",
       "                        <td id=\"T_b6579_row1_col4\" class=\"data row1 col4\" >-1.3479%</td>\n",
       "                        <td id=\"T_b6579_row1_col5\" class=\"data row1 col5\" >-0.3326%</td>\n",
       "                        <td id=\"T_b6579_row1_col6\" class=\"data row1 col6\" >0.0215%</td>\n",
       "                        <td id=\"T_b6579_row1_col7\" class=\"data row1 col7\" >-0.1626%</td>\n",
       "                        <td id=\"T_b6579_row1_col8\" class=\"data row1 col8\" >-0.3076%</td>\n",
       "                        <td id=\"T_b6579_row1_col9\" class=\"data row1 col9\" >-0.3041%</td>\n",
       "                        <td id=\"T_b6579_row1_col10\" class=\"data row1 col10\" >-0.2286%</td>\n",
       "                        <td id=\"T_b6579_row1_col11\" class=\"data row1 col11\" >-0.4459%</td>\n",
       "                        <td id=\"T_b6579_row1_col12\" class=\"data row1 col12\" >-0.4651%</td>\n",
       "                        <td id=\"T_b6579_row1_col13\" class=\"data row1 col13\" >-0.2146%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_b6579_level0_row2\" class=\"row_heading level0 row2\" >2017-11-14 00:00:00</th>\n",
       "                        <td id=\"T_b6579_row2_col0\" class=\"data row2 col0\" >-3.7020%</td>\n",
       "                        <td id=\"T_b6579_row2_col1\" class=\"data row2 col1\" >-1.0470%</td>\n",
       "                        <td id=\"T_b6579_row2_col2\" class=\"data row2 col2\" >1.0800%</td>\n",
       "                        <td id=\"T_b6579_row2_col3\" class=\"data row2 col3\" >0.8975%</td>\n",
       "                        <td id=\"T_b6579_row2_col4\" class=\"data row2 col4\" >-0.1548%</td>\n",
       "                        <td id=\"T_b6579_row2_col5\" class=\"data row2 col5\" >0.2668%</td>\n",
       "                        <td id=\"T_b6579_row2_col6\" class=\"data row2 col6\" >2.6950%</td>\n",
       "                        <td id=\"T_b6579_row2_col7\" class=\"data row2 col7\" >0.2320%</td>\n",
       "                        <td id=\"T_b6579_row2_col8\" class=\"data row2 col8\" >0.0236%</td>\n",
       "                        <td id=\"T_b6579_row2_col9\" class=\"data row2 col9\" >0.1040%</td>\n",
       "                        <td id=\"T_b6579_row2_col10\" class=\"data row2 col10\" >0.2373%</td>\n",
       "                        <td id=\"T_b6579_row2_col11\" class=\"data row2 col11\" >-0.2741%</td>\n",
       "                        <td id=\"T_b6579_row2_col12\" class=\"data row2 col12\" >-0.3932%</td>\n",
       "                        <td id=\"T_b6579_row2_col13\" class=\"data row2 col13\" >0.2151%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_b6579_level0_row3\" class=\"row_heading level0 row3\" >2017-11-13 00:00:00</th>\n",
       "                        <td id=\"T_b6579_row3_col0\" class=\"data row3 col0\" >-1.4503%</td>\n",
       "                        <td id=\"T_b6579_row3_col1\" class=\"data row3 col1\" >1.0855%</td>\n",
       "                        <td id=\"T_b6579_row3_col2\" class=\"data row3 col2\" >0.7480%</td>\n",
       "                        <td id=\"T_b6579_row3_col3\" class=\"data row3 col3\" >-0.2826%</td>\n",
       "                        <td id=\"T_b6579_row3_col4\" class=\"data row3 col4\" >0.8179%</td>\n",
       "                        <td id=\"T_b6579_row3_col5\" class=\"data row3 col5\" >1.4205%</td>\n",
       "                        <td id=\"T_b6579_row3_col6\" class=\"data row3 col6\" >3.4145%</td>\n",
       "                        <td id=\"T_b6579_row3_col7\" class=\"data row3 col7\" >0.0906%</td>\n",
       "                        <td id=\"T_b6579_row3_col8\" class=\"data row3 col8\" >0.0064%</td>\n",
       "                        <td id=\"T_b6579_row3_col9\" class=\"data row3 col9\" >-0.0767%</td>\n",
       "                        <td id=\"T_b6579_row3_col10\" class=\"data row3 col10\" >0.0354%</td>\n",
       "                        <td id=\"T_b6579_row3_col11\" class=\"data row3 col11\" >-0.0835%</td>\n",
       "                        <td id=\"T_b6579_row3_col12\" class=\"data row3 col12\" >-0.1114%</td>\n",
       "                        <td id=\"T_b6579_row3_col13\" class=\"data row3 col13\" >-0.0081%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_b6579_level0_row4\" class=\"row_heading level0 row4\" >2017-11-10 00:00:00</th>\n",
       "                        <td id=\"T_b6579_row4_col0\" class=\"data row4 col0\" >-2.4536%</td>\n",
       "                        <td id=\"T_b6579_row4_col1\" class=\"data row4 col1\" >0.7932%</td>\n",
       "                        <td id=\"T_b6579_row4_col2\" class=\"data row4 col2\" >-1.3418%</td>\n",
       "                        <td id=\"T_b6579_row4_col3\" class=\"data row4 col3\" >-0.5155%</td>\n",
       "                        <td id=\"T_b6579_row4_col4\" class=\"data row4 col4\" >0.0710%</td>\n",
       "                        <td id=\"T_b6579_row4_col5\" class=\"data row4 col5\" >-0.9381%</td>\n",
       "                        <td id=\"T_b6579_row4_col6\" class=\"data row4 col6\" >-0.0910%</td>\n",
       "                        <td id=\"T_b6579_row4_col7\" class=\"data row4 col7\" >0.1194%</td>\n",
       "                        <td id=\"T_b6579_row4_col8\" class=\"data row4 col8\" >0.3792%</td>\n",
       "                        <td id=\"T_b6579_row4_col9\" class=\"data row4 col9\" >0.3047%</td>\n",
       "                        <td id=\"T_b6579_row4_col10\" class=\"data row4 col10\" >0.1355%</td>\n",
       "                        <td id=\"T_b6579_row4_col11\" class=\"data row4 col11\" >0.7118%</td>\n",
       "                        <td id=\"T_b6579_row4_col12\" class=\"data row4 col12\" >0.8207%</td>\n",
       "                        <td id=\"T_b6579_row4_col13\" class=\"data row4 col13\" >-0.0090%</td>\n",
       "            </tr>\n",
       "    </tbody></table>"
      ],
      "text/plain": [
       "<pandas.io.formats.style.Styler at 0x7f8d094424f0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "########################################################################\n",
    "# Uploading Data\n",
    "########################################################################\n",
    "\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "\n",
    "# Interest Rates Data\n",
    "kr = pd.read_excel('KeyRates.xlsx', engine='openpyxl', index_col=0, header=0)/100\n",
    "\n",
    "# Prices  Data\n",
    "assets = pd.read_excel('Assets.xlsx', engine='openpyxl', index_col=0, header=0)\n",
    "\n",
    "# Find common dates\n",
    "a = pd.merge(left=assets, right=kr, how='inner', on='Date')\n",
    "dates = a.index\n",
    "\n",
    "# Calculate interest rates returns\n",
    "kr_returns = kr.loc[dates,:].sort_index().diff().dropna()\n",
    "kr_returns.sort_index(ascending=False, inplace=True)\n",
    "\n",
    "# List of instruments\n",
    "equity = ['APA','CMCSA','CNP','HPQ','PSA','SEE','ZION']\n",
    "bonds = ['PEP11900D031', 'PEP13000D012', 'PEP13000M088',\n",
    "         'PEP23900M103','PEP70101M530','PEP70101M571',\n",
    "         'PEP70310M156']\n",
    "factors = ['MTUM','QUAL','SIZE','USMV','VLUE']\n",
    "\n",
    "# Calculate assets returns\n",
    "assets_returns = assets.loc[dates, equity + bonds]\n",
    "assets_returns = assets_returns.sort_index().pct_change().dropna()\n",
    "assets_returns.sort_index(ascending=False, inplace=True)\n",
    "\n",
    "# Calculate factors returns\n",
    "factors_returns = assets.loc[dates, factors]\n",
    "factors_returns = factors_returns.sort_index().pct_change().dropna()\n",
    "factors_returns.sort_index(ascending=False, inplace=True)\n",
    "\n",
    "# Show tables\n",
    "display(kr_returns.head().style.format(\"{:.4%}\"))\n",
    "display(assets_returns.head().style.format(\"{:.4%}\"))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Durations Matrix\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<style  type=\"text/css\" >\n",
       "#T_8a4a9_row0_col0{\n",
       "            background-color:  #006034;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_8a4a9_row0_col1{\n",
       "            background-color:  #2c8f4b;\n",
       "            color:  #000000;\n",
       "        }#T_8a4a9_row0_col2,#T_8a4a9_row0_col3,#T_8a4a9_row0_col4,#T_8a4a9_row1_col1,#T_8a4a9_row2_col0,#T_8a4a9_row3_col5,#T_8a4a9_row4_col6,#T_8a4a9_row4_col7{\n",
       "            background-color:  #004529;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_8a4a9_row0_col5{\n",
       "            background-color:  #2f944e;\n",
       "            color:  #000000;\n",
       "        }#T_8a4a9_row0_col6,#T_8a4a9_row0_col7,#T_8a4a9_row0_col8,#T_8a4a9_row1_col0,#T_8a4a9_row1_col8,#T_8a4a9_row2_col1,#T_8a4a9_row2_col7,#T_8a4a9_row2_col8,#T_8a4a9_row3_col0,#T_8a4a9_row3_col3,#T_8a4a9_row3_col4,#T_8a4a9_row3_col7,#T_8a4a9_row3_col8,#T_8a4a9_row4_col0,#T_8a4a9_row4_col2,#T_8a4a9_row4_col5,#T_8a4a9_row4_col8{\n",
       "            background-color:  #ffffe5;\n",
       "            color:  #000000;\n",
       "        }#T_8a4a9_row1_col2{\n",
       "            background-color:  #8ed082;\n",
       "            color:  #000000;\n",
       "        }#T_8a4a9_row1_col3{\n",
       "            background-color:  #3ba358;\n",
       "            color:  #000000;\n",
       "        }#T_8a4a9_row1_col4{\n",
       "            background-color:  #238443;\n",
       "            color:  #000000;\n",
       "        }#T_8a4a9_row1_col5{\n",
       "            background-color:  #fbfdce;\n",
       "            color:  #000000;\n",
       "        }#T_8a4a9_row1_col6{\n",
       "            background-color:  #004a2b;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_8a4a9_row1_col7{\n",
       "            background-color:  #fbfed2;\n",
       "            color:  #000000;\n",
       "        }#T_8a4a9_row2_col2{\n",
       "            background-color:  #77c679;\n",
       "            color:  #000000;\n",
       "        }#T_8a4a9_row2_col3{\n",
       "            background-color:  #cbea9c;\n",
       "            color:  #000000;\n",
       "        }#T_8a4a9_row2_col4{\n",
       "            background-color:  #b6e192;\n",
       "            color:  #000000;\n",
       "        }#T_8a4a9_row2_col5{\n",
       "            background-color:  #74c477;\n",
       "            color:  #000000;\n",
       "        }#T_8a4a9_row2_col6{\n",
       "            background-color:  #40aa5c;\n",
       "            color:  #000000;\n",
       "        }#T_8a4a9_row3_col1{\n",
       "            background-color:  #feffde;\n",
       "            color:  #000000;\n",
       "        }#T_8a4a9_row3_col2{\n",
       "            background-color:  #eaf7af;\n",
       "            color:  #000000;\n",
       "        }#T_8a4a9_row3_col6{\n",
       "            background-color:  #ffffe4;\n",
       "            color:  #000000;\n",
       "        }#T_8a4a9_row4_col1{\n",
       "            background-color:  #39a056;\n",
       "            color:  #000000;\n",
       "        }#T_8a4a9_row4_col3{\n",
       "            background-color:  #f8fcbe;\n",
       "            color:  #000000;\n",
       "        }#T_8a4a9_row4_col4{\n",
       "            background-color:  #f1fab5;\n",
       "            color:  #000000;\n",
       "        }</style><table id=\"T_8a4a9_\" ><thead>    <tr>        <th class=\"blank level0\" ></th>        <th class=\"col_heading level0 col0\" >R 0</th>        <th class=\"col_heading level0 col1\" >R 90</th>        <th class=\"col_heading level0 col2\" >R 180</th>        <th class=\"col_heading level0 col3\" >R 360</th>        <th class=\"col_heading level0 col4\" >R 720</th>        <th class=\"col_heading level0 col5\" >R 1800</th>        <th class=\"col_heading level0 col6\" >R 3600</th>        <th class=\"col_heading level0 col7\" >R 7200</th>        <th class=\"col_heading level0 col8\" >R 10800</th>    </tr></thead><tbody>\n",
       "                <tr>\n",
       "                        <th id=\"T_8a4a9_level0_row0\" class=\"row_heading level0 row0\" >PEP11900D031</th>\n",
       "                        <td id=\"T_8a4a9_row0_col0\" class=\"data row0 col0\" >0.0012</td>\n",
       "                        <td id=\"T_8a4a9_row0_col1\" class=\"data row0 col1\" >0.0057</td>\n",
       "                        <td id=\"T_8a4a9_row0_col2\" class=\"data row0 col2\" >0.0192</td>\n",
       "                        <td id=\"T_8a4a9_row0_col3\" class=\"data row0 col3\" >0.0730</td>\n",
       "                        <td id=\"T_8a4a9_row0_col4\" class=\"data row0 col4\" >0.3685</td>\n",
       "                        <td id=\"T_8a4a9_row0_col5\" class=\"data row0 col5\" >3.0416</td>\n",
       "                        <td id=\"T_8a4a9_row0_col6\" class=\"data row0 col6\" >0.0030</td>\n",
       "                        <td id=\"T_8a4a9_row0_col7\" class=\"data row0 col7\" >0.0000</td>\n",
       "                        <td id=\"T_8a4a9_row0_col8\" class=\"data row0 col8\" >0.0000</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_8a4a9_level0_row1\" class=\"row_heading level0 row1\" >PEP13000D012</th>\n",
       "                        <td id=\"T_8a4a9_row1_col0\" class=\"data row1 col0\" >0.0000</td>\n",
       "                        <td id=\"T_8a4a9_row1_col1\" class=\"data row1 col1\" >0.0078</td>\n",
       "                        <td id=\"T_8a4a9_row1_col2\" class=\"data row1 col2\" >0.0142</td>\n",
       "                        <td id=\"T_8a4a9_row1_col3\" class=\"data row1 col3\" >0.0617</td>\n",
       "                        <td id=\"T_8a4a9_row1_col4\" class=\"data row1 col4\" >0.3327</td>\n",
       "                        <td id=\"T_8a4a9_row1_col5\" class=\"data row1 col5\" >1.0902</td>\n",
       "                        <td id=\"T_8a4a9_row1_col6\" class=\"data row1 col6\" >4.8055</td>\n",
       "                        <td id=\"T_8a4a9_row1_col7\" class=\"data row1 col7\" >0.2074</td>\n",
       "                        <td id=\"T_8a4a9_row1_col8\" class=\"data row1 col8\" >0.0000</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_8a4a9_level0_row2\" class=\"row_heading level0 row2\" >PEP13000M088</th>\n",
       "                        <td id=\"T_8a4a9_row2_col0\" class=\"data row2 col0\" >0.0013</td>\n",
       "                        <td id=\"T_8a4a9_row2_col1\" class=\"data row2 col1\" >0.0004</td>\n",
       "                        <td id=\"T_8a4a9_row2_col2\" class=\"data row2 col2\" >0.0147</td>\n",
       "                        <td id=\"T_8a4a9_row2_col3\" class=\"data row2 col3\" >0.0501</td>\n",
       "                        <td id=\"T_8a4a9_row2_col4\" class=\"data row2 col4\" >0.2770</td>\n",
       "                        <td id=\"T_8a4a9_row2_col5\" class=\"data row2 col5\" >2.4626</td>\n",
       "                        <td id=\"T_8a4a9_row2_col6\" class=\"data row2 col6\" >3.0764</td>\n",
       "                        <td id=\"T_8a4a9_row2_col7\" class=\"data row2 col7\" >0.0000</td>\n",
       "                        <td id=\"T_8a4a9_row2_col8\" class=\"data row2 col8\" >0.0000</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_8a4a9_level0_row3\" class=\"row_heading level0 row3\" >PEP23900M103</th>\n",
       "                        <td id=\"T_8a4a9_row3_col0\" class=\"data row3 col0\" >0.0000</td>\n",
       "                        <td id=\"T_8a4a9_row3_col1\" class=\"data row3 col1\" >0.0005</td>\n",
       "                        <td id=\"T_8a4a9_row3_col2\" class=\"data row3 col2\" >0.0117</td>\n",
       "                        <td id=\"T_8a4a9_row3_col3\" class=\"data row3 col3\" >0.0405</td>\n",
       "                        <td id=\"T_8a4a9_row3_col4\" class=\"data row3 col4\" >0.2274</td>\n",
       "                        <td id=\"T_8a4a9_row3_col5\" class=\"data row3 col5\" >3.9726</td>\n",
       "                        <td id=\"T_8a4a9_row3_col6\" class=\"data row3 col6\" >0.0381</td>\n",
       "                        <td id=\"T_8a4a9_row3_col7\" class=\"data row3 col7\" >0.0000</td>\n",
       "                        <td id=\"T_8a4a9_row3_col8\" class=\"data row3 col8\" >0.0000</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_8a4a9_level0_row4\" class=\"row_heading level0 row4\" >PEP70101M530</th>\n",
       "                        <td id=\"T_8a4a9_row4_col0\" class=\"data row4 col0\" >0.0000</td>\n",
       "                        <td id=\"T_8a4a9_row4_col1\" class=\"data row4 col1\" >0.0052</td>\n",
       "                        <td id=\"T_8a4a9_row4_col2\" class=\"data row4 col2\" >0.0101</td>\n",
       "                        <td id=\"T_8a4a9_row4_col3\" class=\"data row4 col3\" >0.0442</td>\n",
       "                        <td id=\"T_8a4a9_row4_col4\" class=\"data row4 col4\" >0.2488</td>\n",
       "                        <td id=\"T_8a4a9_row4_col5\" class=\"data row4 col5\" >0.8826</td>\n",
       "                        <td id=\"T_8a4a9_row4_col6\" class=\"data row4 col6\" >4.9147</td>\n",
       "                        <td id=\"T_8a4a9_row4_col7\" class=\"data row4 col7\" >3.5537</td>\n",
       "                        <td id=\"T_8a4a9_row4_col8\" class=\"data row4 col8\" >0.0000</td>\n",
       "            </tr>\n",
       "    </tbody></table>"
      ],
      "text/plain": [
       "<pandas.io.formats.style.Styler at 0x7f8d09473d00>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "Convexities Matrix\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<style  type=\"text/css\" >\n",
       "#T_ea8e8_row0_col0{\n",
       "            background-color:  #b9e294;\n",
       "            color:  #000000;\n",
       "        }#T_ea8e8_row0_col1{\n",
       "            background-color:  #5db96b;\n",
       "            color:  #000000;\n",
       "        }#T_ea8e8_row0_col2{\n",
       "            background-color:  #10743c;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_ea8e8_row0_col3,#T_ea8e8_row0_col4,#T_ea8e8_row1_col1,#T_ea8e8_row1_col6,#T_ea8e8_row2_col0,#T_ea8e8_row2_col2,#T_ea8e8_row3_col5,#T_ea8e8_row4_col7{\n",
       "            background-color:  #004529;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_ea8e8_row0_col5{\n",
       "            background-color:  #3da559;\n",
       "            color:  #000000;\n",
       "        }#T_ea8e8_row0_col6,#T_ea8e8_row0_col7,#T_ea8e8_row0_col8,#T_ea8e8_row1_col0,#T_ea8e8_row1_col8,#T_ea8e8_row2_col7,#T_ea8e8_row2_col8,#T_ea8e8_row3_col0,#T_ea8e8_row3_col1,#T_ea8e8_row3_col4,#T_ea8e8_row3_col6,#T_ea8e8_row3_col7,#T_ea8e8_row3_col8,#T_ea8e8_row4_col0,#T_ea8e8_row4_col2,#T_ea8e8_row4_col3,#T_ea8e8_row4_col5,#T_ea8e8_row4_col8{\n",
       "            background-color:  #ffffe5;\n",
       "            color:  #000000;\n",
       "        }#T_ea8e8_row1_col2{\n",
       "            background-color:  #f6fcb8;\n",
       "            color:  #000000;\n",
       "        }#T_ea8e8_row1_col3{\n",
       "            background-color:  #69bf72;\n",
       "            color:  #000000;\n",
       "        }#T_ea8e8_row1_col4{\n",
       "            background-color:  #167a3f;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_ea8e8_row1_col5{\n",
       "            background-color:  #fcfed7;\n",
       "            color:  #000000;\n",
       "        }#T_ea8e8_row1_col7{\n",
       "            background-color:  #ffffe4;\n",
       "            color:  #000000;\n",
       "        }#T_ea8e8_row2_col1{\n",
       "            background-color:  #feffe2;\n",
       "            color:  #000000;\n",
       "        }#T_ea8e8_row2_col3{\n",
       "            background-color:  #81ca7d;\n",
       "            color:  #000000;\n",
       "        }#T_ea8e8_row2_col4{\n",
       "            background-color:  #a7db8c;\n",
       "            color:  #000000;\n",
       "        }#T_ea8e8_row2_col5{\n",
       "            background-color:  #cfec9e;\n",
       "            color:  #000000;\n",
       "        }#T_ea8e8_row2_col6{\n",
       "            background-color:  #b2df90;\n",
       "            color:  #000000;\n",
       "        }#T_ea8e8_row3_col2{\n",
       "            background-color:  #258745;\n",
       "            color:  #000000;\n",
       "        }#T_ea8e8_row3_col3{\n",
       "            background-color:  #def2a7;\n",
       "            color:  #000000;\n",
       "        }#T_ea8e8_row4_col1{\n",
       "            background-color:  #3aa257;\n",
       "            color:  #000000;\n",
       "        }#T_ea8e8_row4_col4{\n",
       "            background-color:  #f3fab6;\n",
       "            color:  #000000;\n",
       "        }#T_ea8e8_row4_col6{\n",
       "            background-color:  #086e3a;\n",
       "            color:  #f1f1f1;\n",
       "        }</style><table id=\"T_ea8e8_\" ><thead>    <tr>        <th class=\"blank level0\" ></th>        <th class=\"col_heading level0 col0\" >R^2 0</th>        <th class=\"col_heading level0 col1\" >R^2 90</th>        <th class=\"col_heading level0 col2\" >R^2 180</th>        <th class=\"col_heading level0 col3\" >R^2 360</th>        <th class=\"col_heading level0 col4\" >R^2 720</th>        <th class=\"col_heading level0 col5\" >R^2 1800</th>        <th class=\"col_heading level0 col6\" >R^2 3600</th>        <th class=\"col_heading level0 col7\" >R^2 7200</th>        <th class=\"col_heading level0 col8\" >R^2 10800</th>    </tr></thead><tbody>\n",
       "                <tr>\n",
       "                        <th id=\"T_ea8e8_level0_row0\" class=\"row_heading level0 row0\" >PEP11900D031</th>\n",
       "                        <td id=\"T_ea8e8_row0_col0\" class=\"data row0 col0\" >0.0004</td>\n",
       "                        <td id=\"T_ea8e8_row0_col1\" class=\"data row0 col1\" >0.0032</td>\n",
       "                        <td id=\"T_ea8e8_row0_col2\" class=\"data row0 col2\" >0.0167</td>\n",
       "                        <td id=\"T_ea8e8_row0_col3\" class=\"data row0 col3\" >0.0928</td>\n",
       "                        <td id=\"T_ea8e8_row0_col4\" class=\"data row0 col4\" >0.7741</td>\n",
       "                        <td id=\"T_ea8e8_row0_col5\" class=\"data row0 col5\" >15.5617</td>\n",
       "                        <td id=\"T_ea8e8_row0_col6\" class=\"data row0 col6\" >0.0000</td>\n",
       "                        <td id=\"T_ea8e8_row0_col7\" class=\"data row0 col7\" >0.0000</td>\n",
       "                        <td id=\"T_ea8e8_row0_col8\" class=\"data row0 col8\" >0.0000</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_ea8e8_level0_row1\" class=\"row_heading level0 row1\" >PEP13000D012</th>\n",
       "                        <td id=\"T_ea8e8_row1_col0\" class=\"data row1 col0\" >0.0000</td>\n",
       "                        <td id=\"T_ea8e8_row1_col1\" class=\"data row1 col1\" >0.0057</td>\n",
       "                        <td id=\"T_ea8e8_row1_col2\" class=\"data row1 col2\" >0.0070</td>\n",
       "                        <td id=\"T_ea8e8_row1_col3\" class=\"data row1 col3\" >0.0756</td>\n",
       "                        <td id=\"T_ea8e8_row1_col4\" class=\"data row1 col4\" >0.7210</td>\n",
       "                        <td id=\"T_ea8e8_row1_col5\" class=\"data row1 col5\" >4.4984</td>\n",
       "                        <td id=\"T_ea8e8_row1_col6\" class=\"data row1 col6\" >45.2159</td>\n",
       "                        <td id=\"T_ea8e8_row1_col7\" class=\"data row1 col7\" >0.1105</td>\n",
       "                        <td id=\"T_ea8e8_row1_col8\" class=\"data row1 col8\" >0.0000</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_ea8e8_level0_row2\" class=\"row_heading level0 row2\" >PEP13000M088</th>\n",
       "                        <td id=\"T_ea8e8_row2_col0\" class=\"data row2 col0\" >0.0010</td>\n",
       "                        <td id=\"T_ea8e8_row2_col1\" class=\"data row2 col1\" >0.0001</td>\n",
       "                        <td id=\"T_ea8e8_row2_col2\" class=\"data row2 col2\" >0.0192</td>\n",
       "                        <td id=\"T_ea8e8_row2_col3\" class=\"data row2 col3\" >0.0736</td>\n",
       "                        <td id=\"T_ea8e8_row2_col4\" class=\"data row2 col4\" >0.6161</td>\n",
       "                        <td id=\"T_ea8e8_row2_col5\" class=\"data row2 col5\" >8.8479</td>\n",
       "                        <td id=\"T_ea8e8_row2_col6\" class=\"data row2 col6\" >16.2880</td>\n",
       "                        <td id=\"T_ea8e8_row2_col7\" class=\"data row2 col7\" >0.0000</td>\n",
       "                        <td id=\"T_ea8e8_row2_col8\" class=\"data row2 col8\" >0.0000</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_ea8e8_level0_row3\" class=\"row_heading level0 row3\" >PEP23900M103</th>\n",
       "                        <td id=\"T_ea8e8_row3_col0\" class=\"data row3 col0\" >0.0000</td>\n",
       "                        <td id=\"T_ea8e8_row3_col1\" class=\"data row3 col1\" >0.0000</td>\n",
       "                        <td id=\"T_ea8e8_row3_col2\" class=\"data row3 col2\" >0.0156</td>\n",
       "                        <td id=\"T_ea8e8_row3_col3\" class=\"data row3 col3\" >0.0644</td>\n",
       "                        <td id=\"T_ea8e8_row3_col4\" class=\"data row3 col4\" >0.5161</td>\n",
       "                        <td id=\"T_ea8e8_row3_col5\" class=\"data row3 col5\" >22.1272</td>\n",
       "                        <td id=\"T_ea8e8_row3_col6\" class=\"data row3 col6\" >0.0022</td>\n",
       "                        <td id=\"T_ea8e8_row3_col7\" class=\"data row3 col7\" >0.0000</td>\n",
       "                        <td id=\"T_ea8e8_row3_col8\" class=\"data row3 col8\" >0.0000</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_ea8e8_level0_row4\" class=\"row_heading level0 row4\" >PEP70101M530</th>\n",
       "                        <td id=\"T_ea8e8_row4_col0\" class=\"data row4 col0\" >0.0000</td>\n",
       "                        <td id=\"T_ea8e8_row4_col1\" class=\"data row4 col1\" >0.0038</td>\n",
       "                        <td id=\"T_ea8e8_row4_col2\" class=\"data row4 col2\" >0.0052</td>\n",
       "                        <td id=\"T_ea8e8_row4_col3\" class=\"data row4 col3\" >0.0561</td>\n",
       "                        <td id=\"T_ea8e8_row4_col4\" class=\"data row4 col4\" >0.5530</td>\n",
       "                        <td id=\"T_ea8e8_row4_col5\" class=\"data row4 col5\" >3.7373</td>\n",
       "                        <td id=\"T_ea8e8_row4_col6\" class=\"data row4 col6\" >38.2315</td>\n",
       "                        <td id=\"T_ea8e8_row4_col7\" class=\"data row4 col7\" >26.1464</td>\n",
       "                        <td id=\"T_ea8e8_row4_col8\" class=\"data row4 col8\" >0.0000</td>\n",
       "            </tr>\n",
       "    </tbody></table>"
      ],
      "text/plain": [
       "<pandas.io.formats.style.Styler at 0x7f8d0a5f0520>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "########################################################################\n",
    "# Uploading Duration and Convexity Matrixes\n",
    "########################################################################\n",
    "\n",
    "durations = pd.read_excel('durations.xlsx', index_col=0, header=0)\n",
    "convexity = pd.read_excel('convexity.xlsx', index_col=0, header=0)\n",
    "\n",
    "print('Durations Matrix')\n",
    "display(durations.head().style.format(\"{:.4f}\").background_gradient(cmap='YlGn'))\n",
    "print('')\n",
    "print('Convexities Matrix')\n",
    "display(convexity.head().style.format(\"{:.4f}\").background_gradient(cmap='YlGn'))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2. Estimating Black Litterman with Factors for Fixed Income Portfolios\n",
    "\n",
    "### 2.1 Building the loadings matrix and risk factors returns\n",
    "\n",
    "This part shows how to build a personalized loadings matrix that will be used by Riskfolio-Lib to calculate the expected returns and covariance matrix."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<style  type=\"text/css\" >\n",
       "#T_e7a5b_row0_col0{\n",
       "            background-color:  #e2f4aa;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row0_col1{\n",
       "            background-color:  #ccea9d;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row0_col2,#T_e7a5b_row0_col3,#T_e7a5b_row0_col4,#T_e7a5b_row0_col15,#T_e7a5b_row0_col16,#T_e7a5b_row0_col17,#T_e7a5b_row1_col1,#T_e7a5b_row1_col9,#T_e7a5b_row1_col16,#T_e7a5b_row1_col17,#T_e7a5b_row2_col16,#T_e7a5b_row2_col17,#T_e7a5b_row3_col5,#T_e7a5b_row3_col9,#T_e7a5b_row3_col10,#T_e7a5b_row3_col15,#T_e7a5b_row3_col16,#T_e7a5b_row3_col17,#T_e7a5b_row4_col6,#T_e7a5b_row4_col9,#T_e7a5b_row4_col11,#T_e7a5b_row4_col14,#T_e7a5b_row4_col17,#T_e7a5b_row5_col0,#T_e7a5b_row5_col7,#T_e7a5b_row5_col8,#T_e7a5b_row6_col9,#T_e7a5b_row6_col12,#T_e7a5b_row6_col13,#T_e7a5b_row6_col15,#T_e7a5b_row6_col16,#T_e7a5b_row6_col17{\n",
       "            background-color:  #ffffe5;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row0_col5{\n",
       "            background-color:  #c7e89a;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row0_col6,#T_e7a5b_row0_col7,#T_e7a5b_row0_col8,#T_e7a5b_row0_col12,#T_e7a5b_row0_col13,#T_e7a5b_row1_col0,#T_e7a5b_row1_col8,#T_e7a5b_row1_col10,#T_e7a5b_row1_col15,#T_e7a5b_row2_col1,#T_e7a5b_row2_col7,#T_e7a5b_row2_col8,#T_e7a5b_row2_col9,#T_e7a5b_row2_col11,#T_e7a5b_row3_col0,#T_e7a5b_row3_col4,#T_e7a5b_row3_col7,#T_e7a5b_row3_col8,#T_e7a5b_row3_col14,#T_e7a5b_row4_col0,#T_e7a5b_row4_col5,#T_e7a5b_row4_col8,#T_e7a5b_row5_col16,#T_e7a5b_row5_col17,#T_e7a5b_row6_col0,#T_e7a5b_row6_col2,#T_e7a5b_row6_col3,#T_e7a5b_row6_col6,#T_e7a5b_row6_col7,#T_e7a5b_row6_col8{\n",
       "            background-color:  #004529;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_e7a5b_row0_col9,#T_e7a5b_row4_col1{\n",
       "            background-color:  #b9e294;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row0_col10,#T_e7a5b_row1_col12,#T_e7a5b_row5_col10{\n",
       "            background-color:  #5db96b;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row0_col11{\n",
       "            background-color:  #10743c;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_e7a5b_row0_col14{\n",
       "            background-color:  #3da559;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row1_col2{\n",
       "            background-color:  #6bc072;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row1_col3{\n",
       "            background-color:  #b8e293;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row1_col4{\n",
       "            background-color:  #d9f0a3;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row1_col5{\n",
       "            background-color:  #005830;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_e7a5b_row1_col6{\n",
       "            background-color:  #feffde;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row1_col7{\n",
       "            background-color:  #004e2d;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_e7a5b_row1_col11{\n",
       "            background-color:  #f6fcb8;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row1_col13{\n",
       "            background-color:  #13773d;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_e7a5b_row1_col14{\n",
       "            background-color:  #fcfed7;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row2_col0{\n",
       "            background-color:  #f7fcb9;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row2_col2{\n",
       "            background-color:  #81ca7d;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row2_col3,#T_e7a5b_row5_col3{\n",
       "            background-color:  #2f934d;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row2_col4{\n",
       "            background-color:  #3ba358;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row2_col5{\n",
       "            background-color:  #7cc87b;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row2_col6{\n",
       "            background-color:  #aedd8e;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row2_col10{\n",
       "            background-color:  #feffe2;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row2_col12{\n",
       "            background-color:  #74c477;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row2_col13{\n",
       "            background-color:  #9ad587;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row2_col14{\n",
       "            background-color:  #cfec9e;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row2_col15,#T_e7a5b_row6_col10{\n",
       "            background-color:  #b2df90;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row3_col1{\n",
       "            background-color:  #004a2b;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_e7a5b_row3_col2{\n",
       "            background-color:  #197c40;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_e7a5b_row3_col3{\n",
       "            background-color:  #00472a;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_e7a5b_row3_col6{\n",
       "            background-color:  #004629;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_e7a5b_row3_col11{\n",
       "            background-color:  #258745;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row3_col12{\n",
       "            background-color:  #d0ec9f;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row3_col13,#T_e7a5b_row6_col11{\n",
       "            background-color:  #fcfed3;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row4_col2{\n",
       "            background-color:  #00512e;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_e7a5b_row4_col3{\n",
       "            background-color:  #006636;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_e7a5b_row4_col4{\n",
       "            background-color:  #076d39;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_e7a5b_row4_col7{\n",
       "            background-color:  #9dd688;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row4_col10{\n",
       "            background-color:  #3aa257;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row4_col12{\n",
       "            background-color:  #fbfdcf;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row4_col13{\n",
       "            background-color:  #e8f6ae;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row4_col15{\n",
       "            background-color:  #086e3a;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_e7a5b_row4_col16{\n",
       "            background-color:  #d5eea1;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row5_col1{\n",
       "            background-color:  #6fc174;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row5_col2{\n",
       "            background-color:  #30954f;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row5_col4{\n",
       "            background-color:  #49af61;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row5_col5,#T_e7a5b_row6_col14{\n",
       "            background-color:  #00502d;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_e7a5b_row5_col6{\n",
       "            background-color:  #83cb7d;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row5_col9{\n",
       "            background-color:  #89ce80;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row5_col11{\n",
       "            background-color:  #66bd70;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row5_col12{\n",
       "            background-color:  #d6efa2;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row5_col13,#T_e7a5b_row5_col15{\n",
       "            background-color:  #8dcf81;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row5_col14{\n",
       "            background-color:  #fdfedb;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row6_col1{\n",
       "            background-color:  #6dc073;\n",
       "            color:  #000000;\n",
       "        }#T_e7a5b_row6_col4{\n",
       "            background-color:  #208242;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_e7a5b_row6_col5{\n",
       "            background-color:  #fdfedd;\n",
       "            color:  #000000;\n",
       "        }</style><table id=\"T_e7a5b_\" ><thead>    <tr>        <th class=\"blank level0\" ></th>        <th class=\"col_heading level0 col0\" >R 0</th>        <th class=\"col_heading level0 col1\" >R 90</th>        <th class=\"col_heading level0 col2\" >R 180</th>        <th class=\"col_heading level0 col3\" >R 360</th>        <th class=\"col_heading level0 col4\" >R 720</th>        <th class=\"col_heading level0 col5\" >R 1800</th>        <th class=\"col_heading level0 col6\" >R 3600</th>        <th class=\"col_heading level0 col7\" >R 7200</th>        <th class=\"col_heading level0 col8\" >R 10800</th>        <th class=\"col_heading level0 col9\" >R^2 0</th>        <th class=\"col_heading level0 col10\" >R^2 90</th>        <th class=\"col_heading level0 col11\" >R^2 180</th>        <th class=\"col_heading level0 col12\" >R^2 360</th>        <th class=\"col_heading level0 col13\" >R^2 720</th>        <th class=\"col_heading level0 col14\" >R^2 1800</th>        <th class=\"col_heading level0 col15\" >R^2 3600</th>        <th class=\"col_heading level0 col16\" >R^2 7200</th>        <th class=\"col_heading level0 col17\" >R^2 10800</th>    </tr></thead><tbody>\n",
       "                <tr>\n",
       "                        <th id=\"T_e7a5b_level0_row0\" class=\"row_heading level0 row0\" >PEP11900D031</th>\n",
       "                        <td id=\"T_e7a5b_row0_col0\" class=\"data row0 col0\" >-0.0012</td>\n",
       "                        <td id=\"T_e7a5b_row0_col1\" class=\"data row0 col1\" >-0.0057</td>\n",
       "                        <td id=\"T_e7a5b_row0_col2\" class=\"data row0 col2\" >-0.0192</td>\n",
       "                        <td id=\"T_e7a5b_row0_col3\" class=\"data row0 col3\" >-0.0730</td>\n",
       "                        <td id=\"T_e7a5b_row0_col4\" class=\"data row0 col4\" >-0.3685</td>\n",
       "                        <td id=\"T_e7a5b_row0_col5\" class=\"data row0 col5\" >-3.0416</td>\n",
       "                        <td id=\"T_e7a5b_row0_col6\" class=\"data row0 col6\" >-0.0030</td>\n",
       "                        <td id=\"T_e7a5b_row0_col7\" class=\"data row0 col7\" >-0.0000</td>\n",
       "                        <td id=\"T_e7a5b_row0_col8\" class=\"data row0 col8\" >-0.0000</td>\n",
       "                        <td id=\"T_e7a5b_row0_col9\" class=\"data row0 col9\" >0.0002</td>\n",
       "                        <td id=\"T_e7a5b_row0_col10\" class=\"data row0 col10\" >0.0016</td>\n",
       "                        <td id=\"T_e7a5b_row0_col11\" class=\"data row0 col11\" >0.0083</td>\n",
       "                        <td id=\"T_e7a5b_row0_col12\" class=\"data row0 col12\" >0.0464</td>\n",
       "                        <td id=\"T_e7a5b_row0_col13\" class=\"data row0 col13\" >0.3871</td>\n",
       "                        <td id=\"T_e7a5b_row0_col14\" class=\"data row0 col14\" >7.7809</td>\n",
       "                        <td id=\"T_e7a5b_row0_col15\" class=\"data row0 col15\" >0.0000</td>\n",
       "                        <td id=\"T_e7a5b_row0_col16\" class=\"data row0 col16\" >0.0000</td>\n",
       "                        <td id=\"T_e7a5b_row0_col17\" class=\"data row0 col17\" >0.0000</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_e7a5b_level0_row1\" class=\"row_heading level0 row1\" >PEP13000D012</th>\n",
       "                        <td id=\"T_e7a5b_row1_col0\" class=\"data row1 col0\" >-0.0000</td>\n",
       "                        <td id=\"T_e7a5b_row1_col1\" class=\"data row1 col1\" >-0.0078</td>\n",
       "                        <td id=\"T_e7a5b_row1_col2\" class=\"data row1 col2\" >-0.0142</td>\n",
       "                        <td id=\"T_e7a5b_row1_col3\" class=\"data row1 col3\" >-0.0617</td>\n",
       "                        <td id=\"T_e7a5b_row1_col4\" class=\"data row1 col4\" >-0.3327</td>\n",
       "                        <td id=\"T_e7a5b_row1_col5\" class=\"data row1 col5\" >-1.0902</td>\n",
       "                        <td id=\"T_e7a5b_row1_col6\" class=\"data row1 col6\" >-4.8055</td>\n",
       "                        <td id=\"T_e7a5b_row1_col7\" class=\"data row1 col7\" >-0.2074</td>\n",
       "                        <td id=\"T_e7a5b_row1_col8\" class=\"data row1 col8\" >-0.0000</td>\n",
       "                        <td id=\"T_e7a5b_row1_col9\" class=\"data row1 col9\" >0.0000</td>\n",
       "                        <td id=\"T_e7a5b_row1_col10\" class=\"data row1 col10\" >0.0029</td>\n",
       "                        <td id=\"T_e7a5b_row1_col11\" class=\"data row1 col11\" >0.0035</td>\n",
       "                        <td id=\"T_e7a5b_row1_col12\" class=\"data row1 col12\" >0.0378</td>\n",
       "                        <td id=\"T_e7a5b_row1_col13\" class=\"data row1 col13\" >0.3605</td>\n",
       "                        <td id=\"T_e7a5b_row1_col14\" class=\"data row1 col14\" >2.2492</td>\n",
       "                        <td id=\"T_e7a5b_row1_col15\" class=\"data row1 col15\" >22.6080</td>\n",
       "                        <td id=\"T_e7a5b_row1_col16\" class=\"data row1 col16\" >0.0553</td>\n",
       "                        <td id=\"T_e7a5b_row1_col17\" class=\"data row1 col17\" >0.0000</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_e7a5b_level0_row2\" class=\"row_heading level0 row2\" >PEP13000M088</th>\n",
       "                        <td id=\"T_e7a5b_row2_col0\" class=\"data row2 col0\" >-0.0013</td>\n",
       "                        <td id=\"T_e7a5b_row2_col1\" class=\"data row2 col1\" >-0.0004</td>\n",
       "                        <td id=\"T_e7a5b_row2_col2\" class=\"data row2 col2\" >-0.0147</td>\n",
       "                        <td id=\"T_e7a5b_row2_col3\" class=\"data row2 col3\" >-0.0501</td>\n",
       "                        <td id=\"T_e7a5b_row2_col4\" class=\"data row2 col4\" >-0.2770</td>\n",
       "                        <td id=\"T_e7a5b_row2_col5\" class=\"data row2 col5\" >-2.4626</td>\n",
       "                        <td id=\"T_e7a5b_row2_col6\" class=\"data row2 col6\" >-3.0764</td>\n",
       "                        <td id=\"T_e7a5b_row2_col7\" class=\"data row2 col7\" >-0.0000</td>\n",
       "                        <td id=\"T_e7a5b_row2_col8\" class=\"data row2 col8\" >-0.0000</td>\n",
       "                        <td id=\"T_e7a5b_row2_col9\" class=\"data row2 col9\" >0.0005</td>\n",
       "                        <td id=\"T_e7a5b_row2_col10\" class=\"data row2 col10\" >0.0000</td>\n",
       "                        <td id=\"T_e7a5b_row2_col11\" class=\"data row2 col11\" >0.0096</td>\n",
       "                        <td id=\"T_e7a5b_row2_col12\" class=\"data row2 col12\" >0.0368</td>\n",
       "                        <td id=\"T_e7a5b_row2_col13\" class=\"data row2 col13\" >0.3081</td>\n",
       "                        <td id=\"T_e7a5b_row2_col14\" class=\"data row2 col14\" >4.4240</td>\n",
       "                        <td id=\"T_e7a5b_row2_col15\" class=\"data row2 col15\" >8.1440</td>\n",
       "                        <td id=\"T_e7a5b_row2_col16\" class=\"data row2 col16\" >0.0000</td>\n",
       "                        <td id=\"T_e7a5b_row2_col17\" class=\"data row2 col17\" >0.0000</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_e7a5b_level0_row3\" class=\"row_heading level0 row3\" >PEP23900M103</th>\n",
       "                        <td id=\"T_e7a5b_row3_col0\" class=\"data row3 col0\" >-0.0000</td>\n",
       "                        <td id=\"T_e7a5b_row3_col1\" class=\"data row3 col1\" >-0.0005</td>\n",
       "                        <td id=\"T_e7a5b_row3_col2\" class=\"data row3 col2\" >-0.0117</td>\n",
       "                        <td id=\"T_e7a5b_row3_col3\" class=\"data row3 col3\" >-0.0405</td>\n",
       "                        <td id=\"T_e7a5b_row3_col4\" class=\"data row3 col4\" >-0.2274</td>\n",
       "                        <td id=\"T_e7a5b_row3_col5\" class=\"data row3 col5\" >-3.9726</td>\n",
       "                        <td id=\"T_e7a5b_row3_col6\" class=\"data row3 col6\" >-0.0381</td>\n",
       "                        <td id=\"T_e7a5b_row3_col7\" class=\"data row3 col7\" >-0.0000</td>\n",
       "                        <td id=\"T_e7a5b_row3_col8\" class=\"data row3 col8\" >-0.0000</td>\n",
       "                        <td id=\"T_e7a5b_row3_col9\" class=\"data row3 col9\" >0.0000</td>\n",
       "                        <td id=\"T_e7a5b_row3_col10\" class=\"data row3 col10\" >0.0000</td>\n",
       "                        <td id=\"T_e7a5b_row3_col11\" class=\"data row3 col11\" >0.0078</td>\n",
       "                        <td id=\"T_e7a5b_row3_col12\" class=\"data row3 col12\" >0.0322</td>\n",
       "                        <td id=\"T_e7a5b_row3_col13\" class=\"data row3 col13\" >0.2581</td>\n",
       "                        <td id=\"T_e7a5b_row3_col14\" class=\"data row3 col14\" >11.0636</td>\n",
       "                        <td id=\"T_e7a5b_row3_col15\" class=\"data row3 col15\" >0.0011</td>\n",
       "                        <td id=\"T_e7a5b_row3_col16\" class=\"data row3 col16\" >0.0000</td>\n",
       "                        <td id=\"T_e7a5b_row3_col17\" class=\"data row3 col17\" >0.0000</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_e7a5b_level0_row4\" class=\"row_heading level0 row4\" >PEP70101M530</th>\n",
       "                        <td id=\"T_e7a5b_row4_col0\" class=\"data row4 col0\" >-0.0000</td>\n",
       "                        <td id=\"T_e7a5b_row4_col1\" class=\"data row4 col1\" >-0.0052</td>\n",
       "                        <td id=\"T_e7a5b_row4_col2\" class=\"data row4 col2\" >-0.0101</td>\n",
       "                        <td id=\"T_e7a5b_row4_col3\" class=\"data row4 col3\" >-0.0442</td>\n",
       "                        <td id=\"T_e7a5b_row4_col4\" class=\"data row4 col4\" >-0.2488</td>\n",
       "                        <td id=\"T_e7a5b_row4_col5\" class=\"data row4 col5\" >-0.8826</td>\n",
       "                        <td id=\"T_e7a5b_row4_col6\" class=\"data row4 col6\" >-4.9147</td>\n",
       "                        <td id=\"T_e7a5b_row4_col7\" class=\"data row4 col7\" >-3.5537</td>\n",
       "                        <td id=\"T_e7a5b_row4_col8\" class=\"data row4 col8\" >-0.0000</td>\n",
       "                        <td id=\"T_e7a5b_row4_col9\" class=\"data row4 col9\" >0.0000</td>\n",
       "                        <td id=\"T_e7a5b_row4_col10\" class=\"data row4 col10\" >0.0019</td>\n",
       "                        <td id=\"T_e7a5b_row4_col11\" class=\"data row4 col11\" >0.0026</td>\n",
       "                        <td id=\"T_e7a5b_row4_col12\" class=\"data row4 col12\" >0.0280</td>\n",
       "                        <td id=\"T_e7a5b_row4_col13\" class=\"data row4 col13\" >0.2765</td>\n",
       "                        <td id=\"T_e7a5b_row4_col14\" class=\"data row4 col14\" >1.8686</td>\n",
       "                        <td id=\"T_e7a5b_row4_col15\" class=\"data row4 col15\" >19.1157</td>\n",
       "                        <td id=\"T_e7a5b_row4_col16\" class=\"data row4 col16\" >13.0732</td>\n",
       "                        <td id=\"T_e7a5b_row4_col17\" class=\"data row4 col17\" >0.0000</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_e7a5b_level0_row5\" class=\"row_heading level0 row5\" >PEP70101M571</th>\n",
       "                        <td id=\"T_e7a5b_row5_col0\" class=\"data row5 col0\" >-0.0015</td>\n",
       "                        <td id=\"T_e7a5b_row5_col1\" class=\"data row5 col1\" >-0.0039</td>\n",
       "                        <td id=\"T_e7a5b_row5_col2\" class=\"data row5 col2\" >-0.0126</td>\n",
       "                        <td id=\"T_e7a5b_row5_col3\" class=\"data row5 col3\" >-0.0501</td>\n",
       "                        <td id=\"T_e7a5b_row5_col4\" class=\"data row5 col4\" >-0.2829</td>\n",
       "                        <td id=\"T_e7a5b_row5_col5\" class=\"data row5 col5\" >-1.0108</td>\n",
       "                        <td id=\"T_e7a5b_row5_col6\" class=\"data row5 col6\" >-2.5878</td>\n",
       "                        <td id=\"T_e7a5b_row5_col7\" class=\"data row5 col7\" >-6.0312</td>\n",
       "                        <td id=\"T_e7a5b_row5_col8\" class=\"data row5 col8\" >-0.4501</td>\n",
       "                        <td id=\"T_e7a5b_row5_col9\" class=\"data row5 col9\" >0.0002</td>\n",
       "                        <td id=\"T_e7a5b_row5_col10\" class=\"data row5 col10\" >0.0016</td>\n",
       "                        <td id=\"T_e7a5b_row5_col11\" class=\"data row5 col11\" >0.0064</td>\n",
       "                        <td id=\"T_e7a5b_row5_col12\" class=\"data row5 col12\" >0.0319</td>\n",
       "                        <td id=\"T_e7a5b_row5_col13\" class=\"data row5 col13\" >0.3123</td>\n",
       "                        <td id=\"T_e7a5b_row5_col14\" class=\"data row5 col14\" >2.1336</td>\n",
       "                        <td id=\"T_e7a5b_row5_col15\" class=\"data row5 col15\" >10.1632</td>\n",
       "                        <td id=\"T_e7a5b_row5_col16\" class=\"data row5 col16\" >49.9021</td>\n",
       "                        <td id=\"T_e7a5b_row5_col17\" class=\"data row5 col17\" >0.4523</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_e7a5b_level0_row6\" class=\"row_heading level0 row6\" >PEP70310M156</th>\n",
       "                        <td id=\"T_e7a5b_row6_col0\" class=\"data row6 col0\" >-0.0000</td>\n",
       "                        <td id=\"T_e7a5b_row6_col1\" class=\"data row6 col1\" >-0.0039</td>\n",
       "                        <td id=\"T_e7a5b_row6_col2\" class=\"data row6 col2\" >-0.0097</td>\n",
       "                        <td id=\"T_e7a5b_row6_col3\" class=\"data row6 col3\" >-0.0403</td>\n",
       "                        <td id=\"T_e7a5b_row6_col4\" class=\"data row6 col4\" >-0.2614</td>\n",
       "                        <td id=\"T_e7a5b_row6_col5\" class=\"data row6 col5\" >-3.8920</td>\n",
       "                        <td id=\"T_e7a5b_row6_col6\" class=\"data row6 col6\" >-0.0000</td>\n",
       "                        <td id=\"T_e7a5b_row6_col7\" class=\"data row6 col7\" >-0.0000</td>\n",
       "                        <td id=\"T_e7a5b_row6_col8\" class=\"data row6 col8\" >-0.0000</td>\n",
       "                        <td id=\"T_e7a5b_row6_col9\" class=\"data row6 col9\" >0.0000</td>\n",
       "                        <td id=\"T_e7a5b_row6_col10\" class=\"data row6 col10\" >0.0010</td>\n",
       "                        <td id=\"T_e7a5b_row6_col11\" class=\"data row6 col11\" >0.0030</td>\n",
       "                        <td id=\"T_e7a5b_row6_col12\" class=\"data row6 col12\" >0.0268</td>\n",
       "                        <td id=\"T_e7a5b_row6_col13\" class=\"data row6 col13\" >0.2508</td>\n",
       "                        <td id=\"T_e7a5b_row6_col14\" class=\"data row6 col14\" >10.6813</td>\n",
       "                        <td id=\"T_e7a5b_row6_col15\" class=\"data row6 col15\" >0.0000</td>\n",
       "                        <td id=\"T_e7a5b_row6_col16\" class=\"data row6 col16\" >0.0000</td>\n",
       "                        <td id=\"T_e7a5b_row6_col17\" class=\"data row6 col17\" >0.0000</td>\n",
       "            </tr>\n",
       "    </tbody></table>"
      ],
      "text/plain": [
       "<pandas.io.formats.style.Styler at 0x7f8d0a5f00d0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "########################################################################\n",
    "# Building The Loadings Matrix\n",
    "########################################################################\n",
    "\n",
    "loadings = pd.concat([-1.0 * durations, 0.5 * convexity], axis = 1)\n",
    "\n",
    "display(loadings.style.format(\"{:.4f}\").background_gradient(cmap='YlGn'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<style  type=\"text/css\" >\n",
       "</style><table id=\"T_b440e_\" ><thead>    <tr>        <th class=\"blank level0\" ></th>        <th class=\"col_heading level0 col0\" >R 0</th>        <th class=\"col_heading level0 col1\" >R 90</th>        <th class=\"col_heading level0 col2\" >R 180</th>        <th class=\"col_heading level0 col3\" >R 360</th>        <th class=\"col_heading level0 col4\" >R 720</th>        <th class=\"col_heading level0 col5\" >R 1800</th>        <th class=\"col_heading level0 col6\" >R 3600</th>        <th class=\"col_heading level0 col7\" >R 7200</th>        <th class=\"col_heading level0 col8\" >R 10800</th>        <th class=\"col_heading level0 col9\" >R^2 0</th>        <th class=\"col_heading level0 col10\" >R^2 90</th>        <th class=\"col_heading level0 col11\" >R^2 180</th>        <th class=\"col_heading level0 col12\" >R^2 360</th>        <th class=\"col_heading level0 col13\" >R^2 720</th>        <th class=\"col_heading level0 col14\" >R^2 1800</th>        <th class=\"col_heading level0 col15\" >R^2 3600</th>        <th class=\"col_heading level0 col16\" >R^2 7200</th>        <th class=\"col_heading level0 col17\" >R^2 10800</th>    </tr>    <tr>        <th class=\"index_name level0\" >Date</th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>        <th class=\"blank\" ></th>    </tr></thead><tbody>\n",
       "                <tr>\n",
       "                        <th id=\"T_b440e_level0_row0\" class=\"row_heading level0 row0\" >2017-11-16 00:00:00</th>\n",
       "                        <td id=\"T_b440e_row0_col0\" class=\"data row0 col0\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row0_col1\" class=\"data row0 col1\" >0.0059%</td>\n",
       "                        <td id=\"T_b440e_row0_col2\" class=\"data row0 col2\" >0.0108%</td>\n",
       "                        <td id=\"T_b440e_row0_col3\" class=\"data row0 col3\" >0.0178%</td>\n",
       "                        <td id=\"T_b440e_row0_col4\" class=\"data row0 col4\" >0.0246%</td>\n",
       "                        <td id=\"T_b440e_row0_col5\" class=\"data row0 col5\" >0.0213%</td>\n",
       "                        <td id=\"T_b440e_row0_col6\" class=\"data row0 col6\" >0.0075%</td>\n",
       "                        <td id=\"T_b440e_row0_col7\" class=\"data row0 col7\" >-0.0048%</td>\n",
       "                        <td id=\"T_b440e_row0_col8\" class=\"data row0 col8\" >-0.0093%</td>\n",
       "                        <td id=\"T_b440e_row0_col9\" class=\"data row0 col9\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row0_col10\" class=\"data row0 col10\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row0_col11\" class=\"data row0 col11\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row0_col12\" class=\"data row0 col12\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row0_col13\" class=\"data row0 col13\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row0_col14\" class=\"data row0 col14\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row0_col15\" class=\"data row0 col15\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row0_col16\" class=\"data row0 col16\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row0_col17\" class=\"data row0 col17\" >0.0000%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_b440e_level0_row1\" class=\"row_heading level0 row1\" >2017-11-15 00:00:00</th>\n",
       "                        <td id=\"T_b440e_row1_col0\" class=\"data row1 col0\" >0.0180%</td>\n",
       "                        <td id=\"T_b440e_row1_col1\" class=\"data row1 col1\" >0.0247%</td>\n",
       "                        <td id=\"T_b440e_row1_col2\" class=\"data row1 col2\" >0.0303%</td>\n",
       "                        <td id=\"T_b440e_row1_col3\" class=\"data row1 col3\" >0.0391%</td>\n",
       "                        <td id=\"T_b440e_row1_col4\" class=\"data row1 col4\" >0.0495%</td>\n",
       "                        <td id=\"T_b440e_row1_col5\" class=\"data row1 col5\" >0.0558%</td>\n",
       "                        <td id=\"T_b440e_row1_col6\" class=\"data row1 col6\" >0.0512%</td>\n",
       "                        <td id=\"T_b440e_row1_col7\" class=\"data row1 col7\" >0.0450%</td>\n",
       "                        <td id=\"T_b440e_row1_col8\" class=\"data row1 col8\" >0.0417%</td>\n",
       "                        <td id=\"T_b440e_row1_col9\" class=\"data row1 col9\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row1_col10\" class=\"data row1 col10\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row1_col11\" class=\"data row1 col11\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row1_col12\" class=\"data row1 col12\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row1_col13\" class=\"data row1 col13\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row1_col14\" class=\"data row1 col14\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row1_col15\" class=\"data row1 col15\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row1_col16\" class=\"data row1 col16\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row1_col17\" class=\"data row1 col17\" >0.0000%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_b440e_level0_row2\" class=\"row_heading level0 row2\" >2017-11-14 00:00:00</th>\n",
       "                        <td id=\"T_b440e_row2_col0\" class=\"data row2 col0\" >-0.1800%</td>\n",
       "                        <td id=\"T_b440e_row2_col1\" class=\"data row2 col1\" >-0.1710%</td>\n",
       "                        <td id=\"T_b440e_row2_col2\" class=\"data row2 col2\" >-0.1624%</td>\n",
       "                        <td id=\"T_b440e_row2_col3\" class=\"data row2 col3\" >-0.1460%</td>\n",
       "                        <td id=\"T_b440e_row2_col4\" class=\"data row2 col4\" >-0.1167%</td>\n",
       "                        <td id=\"T_b440e_row2_col5\" class=\"data row2 col5\" >-0.0506%</td>\n",
       "                        <td id=\"T_b440e_row2_col6\" class=\"data row2 col6\" >0.0140%</td>\n",
       "                        <td id=\"T_b440e_row2_col7\" class=\"data row2 col7\" >0.0676%</td>\n",
       "                        <td id=\"T_b440e_row2_col8\" class=\"data row2 col8\" >0.0861%</td>\n",
       "                        <td id=\"T_b440e_row2_col9\" class=\"data row2 col9\" >0.0003%</td>\n",
       "                        <td id=\"T_b440e_row2_col10\" class=\"data row2 col10\" >0.0003%</td>\n",
       "                        <td id=\"T_b440e_row2_col11\" class=\"data row2 col11\" >0.0003%</td>\n",
       "                        <td id=\"T_b440e_row2_col12\" class=\"data row2 col12\" >0.0002%</td>\n",
       "                        <td id=\"T_b440e_row2_col13\" class=\"data row2 col13\" >0.0001%</td>\n",
       "                        <td id=\"T_b440e_row2_col14\" class=\"data row2 col14\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row2_col15\" class=\"data row2 col15\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row2_col16\" class=\"data row2 col16\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row2_col17\" class=\"data row2 col17\" >0.0001%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_b440e_level0_row3\" class=\"row_heading level0 row3\" >2017-11-13 00:00:00</th>\n",
       "                        <td id=\"T_b440e_row3_col0\" class=\"data row3 col0\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row3_col1\" class=\"data row3 col1\" >0.0013%</td>\n",
       "                        <td id=\"T_b440e_row3_col2\" class=\"data row3 col2\" >0.0025%</td>\n",
       "                        <td id=\"T_b440e_row3_col3\" class=\"data row3 col3\" >0.0048%</td>\n",
       "                        <td id=\"T_b440e_row3_col4\" class=\"data row3 col4\" >0.0088%</td>\n",
       "                        <td id=\"T_b440e_row3_col5\" class=\"data row3 col5\" >0.0174%</td>\n",
       "                        <td id=\"T_b440e_row3_col6\" class=\"data row3 col6\" >0.0258%</td>\n",
       "                        <td id=\"T_b440e_row3_col7\" class=\"data row3 col7\" >0.0334%</td>\n",
       "                        <td id=\"T_b440e_row3_col8\" class=\"data row3 col8\" >0.0364%</td>\n",
       "                        <td id=\"T_b440e_row3_col9\" class=\"data row3 col9\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row3_col10\" class=\"data row3 col10\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row3_col11\" class=\"data row3 col11\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row3_col12\" class=\"data row3 col12\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row3_col13\" class=\"data row3 col13\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row3_col14\" class=\"data row3 col14\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row3_col15\" class=\"data row3 col15\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row3_col16\" class=\"data row3 col16\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row3_col17\" class=\"data row3 col17\" >0.0000%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_b440e_level0_row4\" class=\"row_heading level0 row4\" >2017-11-10 00:00:00</th>\n",
       "                        <td id=\"T_b440e_row4_col0\" class=\"data row4 col0\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row4_col1\" class=\"data row4 col1\" >0.0026%</td>\n",
       "                        <td id=\"T_b440e_row4_col2\" class=\"data row4 col2\" >0.0043%</td>\n",
       "                        <td id=\"T_b440e_row4_col3\" class=\"data row4 col3\" >0.0054%</td>\n",
       "                        <td id=\"T_b440e_row4_col4\" class=\"data row4 col4\" >0.0017%</td>\n",
       "                        <td id=\"T_b440e_row4_col5\" class=\"data row4 col5\" >-0.0248%</td>\n",
       "                        <td id=\"T_b440e_row4_col6\" class=\"data row4 col6\" >-0.0615%</td>\n",
       "                        <td id=\"T_b440e_row4_col7\" class=\"data row4 col7\" >-0.0936%</td>\n",
       "                        <td id=\"T_b440e_row4_col8\" class=\"data row4 col8\" >-0.1054%</td>\n",
       "                        <td id=\"T_b440e_row4_col9\" class=\"data row4 col9\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row4_col10\" class=\"data row4 col10\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row4_col11\" class=\"data row4 col11\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row4_col12\" class=\"data row4 col12\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row4_col13\" class=\"data row4 col13\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row4_col14\" class=\"data row4 col14\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row4_col15\" class=\"data row4 col15\" >0.0000%</td>\n",
       "                        <td id=\"T_b440e_row4_col16\" class=\"data row4 col16\" >0.0001%</td>\n",
       "                        <td id=\"T_b440e_row4_col17\" class=\"data row4 col17\" >0.0001%</td>\n",
       "            </tr>\n",
       "    </tbody></table>"
      ],
      "text/plain": [
       "<pandas.io.formats.style.Styler at 0x7f8d0a7d7eb0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "########################################################################\n",
    "# Building the risk factors returns matrix\n",
    "########################################################################\n",
    "\n",
    "kr_returns_2 =  kr_returns ** 2\n",
    "cols = loadings.columns\n",
    "\n",
    "X = pd.concat([kr_returns, kr_returns_2], axis=1)\n",
    "X.columns = cols\n",
    "\n",
    "display(X.head().style.format(\"{:.4%}\"))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>PEP11900D031</th>\n",
       "      <th>PEP13000D012</th>\n",
       "      <th>PEP13000M088</th>\n",
       "      <th>PEP23900M103</th>\n",
       "      <th>PEP70101M530</th>\n",
       "      <th>PEP70101M571</th>\n",
       "      <th>PEP70310M156</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2017-11-16</th>\n",
       "      <td>-0.000411</td>\n",
       "      <td>-0.000380</td>\n",
       "      <td>-0.000597</td>\n",
       "      <td>-0.000737</td>\n",
       "      <td>-0.000116</td>\n",
       "      <td>0.000076</td>\n",
       "      <td>-0.000633</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017-11-15</th>\n",
       "      <td>-0.001626</td>\n",
       "      <td>-0.003076</td>\n",
       "      <td>-0.003041</td>\n",
       "      <td>-0.002286</td>\n",
       "      <td>-0.004459</td>\n",
       "      <td>-0.004651</td>\n",
       "      <td>-0.002146</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017-11-14</th>\n",
       "      <td>0.002320</td>\n",
       "      <td>0.000236</td>\n",
       "      <td>0.001040</td>\n",
       "      <td>0.002373</td>\n",
       "      <td>-0.002741</td>\n",
       "      <td>-0.003932</td>\n",
       "      <td>0.002151</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017-11-13</th>\n",
       "      <td>0.000906</td>\n",
       "      <td>0.000064</td>\n",
       "      <td>-0.000767</td>\n",
       "      <td>0.000354</td>\n",
       "      <td>-0.000835</td>\n",
       "      <td>-0.001114</td>\n",
       "      <td>-0.000081</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017-11-10</th>\n",
       "      <td>0.001194</td>\n",
       "      <td>0.003792</td>\n",
       "      <td>0.003047</td>\n",
       "      <td>0.001355</td>\n",
       "      <td>0.007118</td>\n",
       "      <td>0.008207</td>\n",
       "      <td>-0.000090</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            PEP11900D031  PEP13000D012  PEP13000M088  PEP23900M103  \\\n",
       "Date                                                                 \n",
       "2017-11-16     -0.000411     -0.000380     -0.000597     -0.000737   \n",
       "2017-11-15     -0.001626     -0.003076     -0.003041     -0.002286   \n",
       "2017-11-14      0.002320      0.000236      0.001040      0.002373   \n",
       "2017-11-13      0.000906      0.000064     -0.000767      0.000354   \n",
       "2017-11-10      0.001194      0.003792      0.003047      0.001355   \n",
       "\n",
       "            PEP70101M530  PEP70101M571  PEP70310M156  \n",
       "Date                                                  \n",
       "2017-11-16     -0.000116      0.000076     -0.000633  \n",
       "2017-11-15     -0.004459     -0.004651     -0.002146  \n",
       "2017-11-14     -0.002741     -0.003932      0.002151  \n",
       "2017-11-13     -0.000835     -0.001114     -0.000081  \n",
       "2017-11-10      0.007118      0.008207     -0.000090  "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "########################################################################\n",
    "# Building the asset returns matrix\n",
    "########################################################################\n",
    "\n",
    "Y = assets_returns[bonds]\n",
    "\n",
    "display(Y.head())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 2.2 Building views on risk factors"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "R 0         -0.002028\n",
       "R 90        -0.001955\n",
       "R 180       -0.001819\n",
       "R 360       -0.001463\n",
       "R 720       -0.000791\n",
       "R 1800      -0.000530\n",
       "R 3600      -0.002041\n",
       "R 7200      -0.003312\n",
       "R 10800     -0.003533\n",
       "R^2 0        0.000173\n",
       "R^2 90       0.000080\n",
       "R^2 180      0.000049\n",
       "R^2 360      0.000038\n",
       "R^2 720      0.000046\n",
       "R^2 1800     0.000050\n",
       "R^2 3600     0.000057\n",
       "R^2 7200     0.000069\n",
       "R^2 10800    0.000091\n",
       "dtype: float64"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "########################################################################\n",
    "# Showing annualized returns of Fixed Income Risk Factors\n",
    "########################################################################\n",
    "\n",
    "display(X.mean()*252)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Disabled</th>\n",
       "      <th>Factor</th>\n",
       "      <th>Sign</th>\n",
       "      <th>Value</th>\n",
       "      <th>Relative Factor</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>False</td>\n",
       "      <td>R 10800</td>\n",
       "      <td>&gt;=</td>\n",
       "      <td>0.001</td>\n",
       "      <td>R 7200</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>False</td>\n",
       "      <td>R 1800</td>\n",
       "      <td>&lt;=</td>\n",
       "      <td>-0.001</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>False</td>\n",
       "      <td>R 3600</td>\n",
       "      <td>&lt;=</td>\n",
       "      <td>-0.003</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Disabled   Factor Sign  Value Relative Factor\n",
       "0     False  R 10800   >=  0.001          R 7200\n",
       "1     False   R 1800   <= -0.001                \n",
       "2     False   R 3600   <= -0.003                "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "########################################################################\n",
    "# Building views on some Risk Factors\n",
    "########################################################################\n",
    "\n",
    "views = {'Disabled': [False, False, False],\n",
    "        'Factor': ['R 10800','R 1800','R 3600'],\n",
    "        'Sign': ['>=', '<=', '<='],\n",
    "        'Value': [0.001, -0.001, -0.003],\n",
    "        'Relative Factor': ['R 7200', '', '']}\n",
    "\n",
    "views = pd.DataFrame(views)\n",
    "\n",
    "display(views)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Matrix of factors views P_f\n",
      "[[ 0  0  0  0  0  0  0 -1  1  0  0  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0 -1  0  0  0  0  0  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0 -1  0  0  0  0  0  0  0  0  0  0  0]]\n",
      "\n",
      "Matrix of returns of factors views Q_f\n",
      "[[0.001]\n",
      " [0.001]\n",
      " [0.003]]\n"
     ]
    }
   ],
   "source": [
    "########################################################################\n",
    "# Building views matrixes P_f and Q_f\n",
    "########################################################################\n",
    "\n",
    "import riskfolio.ConstraintsFunctions as cf\n",
    "\n",
    "P_f, Q_f = cf.factors_views(views, loadings, const=False)\n",
    "\n",
    "print('Matrix of factors views P_f')\n",
    "print(P_f)\n",
    "print('\\nMatrix of returns of factors views Q_f')\n",
    "print(Q_f)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 2.3 Building Portfolios with mean vector and covariance matrix from Black Litterman with Factors."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "########################################################################\n",
    "# Building the Portfolio Object\n",
    "########################################################################\n",
    "\n",
    "import riskfolio.Portfolio as pf\n",
    "\n",
    "# Building the portfolio object\n",
    "port = pf.Portfolio(returns=Y)\n",
    "\n",
    "# Select method and estimate input parameters:\n",
    "method_mu='hist' # Method to estimate expected returns based on historical data.\n",
    "method_cov='hist' # Method to estimate covariance matrix based on historical data.\n",
    "\n",
    "port.assets_stats(method_mu=method_mu, method_cov=method_cov, d=0.94)\n",
    "\n",
    "port.factors = X\n",
    "port.factors_stats(method_mu=method_mu, method_cov=method_cov, d=0.94, B=loadings)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "You must convert self.cov_bl_fm to a positive definite matrix\n",
      "You must convert self.cov_bl_fm to a positive definite matrix\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<style  type=\"text/css\" >\n",
       "#T_8cdfb_row0_col0,#T_8cdfb_row0_col1,#T_8cdfb_row0_col2,#T_8cdfb_row2_col0,#T_8cdfb_row2_col1,#T_8cdfb_row2_col2,#T_8cdfb_row3_col0,#T_8cdfb_row3_col1,#T_8cdfb_row3_col2,#T_8cdfb_row4_col1,#T_8cdfb_row5_col2,#T_8cdfb_row6_col0,#T_8cdfb_row6_col1,#T_8cdfb_row6_col2{\n",
       "            background-color:  #ffffe5;\n",
       "            color:  #000000;\n",
       "        }#T_8cdfb_row1_col0{\n",
       "            background-color:  #f8fcbe;\n",
       "            color:  #000000;\n",
       "        }#T_8cdfb_row1_col1{\n",
       "            background-color:  #7ac77a;\n",
       "            color:  #000000;\n",
       "        }#T_8cdfb_row1_col2,#T_8cdfb_row5_col0,#T_8cdfb_row5_col1{\n",
       "            background-color:  #004529;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_8cdfb_row4_col0{\n",
       "            background-color:  #69bf72;\n",
       "            color:  #000000;\n",
       "        }#T_8cdfb_row4_col2{\n",
       "            background-color:  #ecf7b1;\n",
       "            color:  #000000;\n",
       "        }</style><table id=\"T_8cdfb_\" ><thead>    <tr>        <th class=\"blank level0\" ></th>        <th class=\"col_heading level0 col0\" >Pure Factors</th>        <th class=\"col_heading level0 col1\" >Bayesian BL</th>        <th class=\"col_heading level0 col2\" >Augmented BL</th>    </tr></thead><tbody>\n",
       "                <tr>\n",
       "                        <th id=\"T_8cdfb_level0_row0\" class=\"row_heading level0 row0\" >PEP11900D031</th>\n",
       "                        <td id=\"T_8cdfb_row0_col0\" class=\"data row0 col0\" >0.0000%</td>\n",
       "                        <td id=\"T_8cdfb_row0_col1\" class=\"data row0 col1\" >0.0000%</td>\n",
       "                        <td id=\"T_8cdfb_row0_col2\" class=\"data row0 col2\" >0.0002%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_8cdfb_level0_row1\" class=\"row_heading level0 row1\" >PEP13000D012</th>\n",
       "                        <td id=\"T_8cdfb_row1_col0\" class=\"data row1 col0\" >6.6666%</td>\n",
       "                        <td id=\"T_8cdfb_row1_col1\" class=\"data row1 col1\" >33.1357%</td>\n",
       "                        <td id=\"T_8cdfb_row1_col2\" class=\"data row1 col2\" >85.2545%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_8cdfb_level0_row2\" class=\"row_heading level0 row2\" >PEP13000M088</th>\n",
       "                        <td id=\"T_8cdfb_row2_col0\" class=\"data row2 col0\" >0.0000%</td>\n",
       "                        <td id=\"T_8cdfb_row2_col1\" class=\"data row2 col1\" >0.0000%</td>\n",
       "                        <td id=\"T_8cdfb_row2_col2\" class=\"data row2 col2\" >0.0004%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_8cdfb_level0_row3\" class=\"row_heading level0 row3\" >PEP23900M103</th>\n",
       "                        <td id=\"T_8cdfb_row3_col0\" class=\"data row3 col0\" >0.0000%</td>\n",
       "                        <td id=\"T_8cdfb_row3_col1\" class=\"data row3 col1\" >0.0000%</td>\n",
       "                        <td id=\"T_8cdfb_row3_col2\" class=\"data row3 col2\" >0.0002%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_8cdfb_level0_row4\" class=\"row_heading level0 row4\" >PEP70101M530</th>\n",
       "                        <td id=\"T_8cdfb_row4_col0\" class=\"data row4 col0\" >32.3836%</td>\n",
       "                        <td id=\"T_8cdfb_row4_col1\" class=\"data row4 col1\" >0.0000%</td>\n",
       "                        <td id=\"T_8cdfb_row4_col2\" class=\"data row4 col2\" >14.7441%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_8cdfb_level0_row5\" class=\"row_heading level0 row5\" >PEP70101M571</th>\n",
       "                        <td id=\"T_8cdfb_row5_col0\" class=\"data row5 col0\" >60.9498%</td>\n",
       "                        <td id=\"T_8cdfb_row5_col1\" class=\"data row5 col1\" >66.8643%</td>\n",
       "                        <td id=\"T_8cdfb_row5_col2\" class=\"data row5 col2\" >0.0004%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_8cdfb_level0_row6\" class=\"row_heading level0 row6\" >PEP70310M156</th>\n",
       "                        <td id=\"T_8cdfb_row6_col0\" class=\"data row6 col0\" >0.0000%</td>\n",
       "                        <td id=\"T_8cdfb_row6_col1\" class=\"data row6 col1\" >0.0000%</td>\n",
       "                        <td id=\"T_8cdfb_row6_col2\" class=\"data row6 col2\" >0.0002%</td>\n",
       "            </tr>\n",
       "    </tbody></table>"
      ],
      "text/plain": [
       "<pandas.io.formats.style.Styler at 0x7f8d0a5f0a30>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "########################################################################\n",
    "# Calculating optimum portfolios using Mean Vector and\n",
    "# Covariance Matrix of Black Litterman with Factors\n",
    "########################################################################\n",
    "\n",
    "port.alpha = 0.05\n",
    "rm = 'MV' # Risk measure used, this time will be variance\n",
    "obj = 'Sharpe' # Objective function, could be MinRisk, MaxRet, Utility or Sharpe\n",
    "hist = False # False: BL covariance and risk factors scenarios\n",
    "         # True: historical covariance and scenarios\n",
    "         # 2: risk factors covariance and scenarios\n",
    "rf = 0 # Risk free rate\n",
    "l = 0 # Risk aversion factor, only useful when obj is 'Utility'\n",
    "\n",
    "w_fm = port.optimization(model='FM', rm=rm, obj=obj, rf=rf, l=l, hist=hist) \n",
    "\n",
    "# Estimate Portfolio weights using Black Litterman Bayesian Model:\n",
    "port.blfactors_stats(flavor='BLB',\n",
    "                     B=loadings,\n",
    "                     P_f=P_f,\n",
    "                     Q_f=Q_f/252,\n",
    "                     rf=0,\n",
    "                     delta=None,\n",
    "                     eq=True,\n",
    "                     const=False,\n",
    "                     diag=False,\n",
    "                     method_mu=method_mu,\n",
    "                     method_cov=method_cov)\n",
    "\n",
    "w_blb = port.optimization(model='BL_FM', rm=rm, obj=obj, rf=rf, l=l, hist=hist)\n",
    "\n",
    "# Estimate Portfolio weights using Augmented Black Litterman Model:\n",
    "port.blfactors_stats(flavor='ABL',\n",
    "                     B=loadings,\n",
    "                     P_f=P_f,\n",
    "                     Q_f=Q_f/252,\n",
    "                     rf=0,\n",
    "                     delta=None,\n",
    "                     eq=True,\n",
    "                     const=False,\n",
    "                     diag=False,\n",
    "                     method_mu=method_mu,\n",
    "                     method_cov=method_cov)\n",
    "\n",
    "w_abl = port.optimization(model='BL_FM', rm=rm, obj=obj, rf=rf, l=l, hist=hist)\n",
    "\n",
    "ws = pd.concat([w_fm, w_blb, w_abl], axis=1)\n",
    "ws.columns = ['Pure Factors', 'Bayesian BL', 'Augmented BL']\n",
    "\n",
    "display(ws.style.format(\"{:.4%}\").background_gradient(cmap='YlGn'))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can see that the we got a messsage that the covariance matrix is not a positive definite matrix, this is common when we work with views on assets or risk factors. In this case, Riskfolio-Lib replace the negative eigenvalues of covariance matrix with zeros and reconstruct the covariance matrix. The problem with this approach is common that the weights that we will get are highly concetrated in few assets.\n",
    "\n",
    "Other approach is using the mean vector estimated with Black Litterman with Factors and the covariance matrix that we get from historical returns or a factor model. An example with this approach follows:"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 2.4 Building Portfolios with mean vector from Black Litterman with Factors."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "You must convert self.cov_bl_fm to a positive definite matrix\n",
      "You must convert self.cov_bl_fm to a positive definite matrix\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<style  type=\"text/css\" >\n",
       "#T_a5008_row0_col0,#T_a5008_row0_col1,#T_a5008_row2_col0,#T_a5008_row2_col2,#T_a5008_row3_col0,#T_a5008_row3_col1,#T_a5008_row6_col0,#T_a5008_row6_col1{\n",
       "            background-color:  #ffffe5;\n",
       "            color:  #000000;\n",
       "        }#T_a5008_row0_col2{\n",
       "            background-color:  #fcfed7;\n",
       "            color:  #000000;\n",
       "        }#T_a5008_row1_col0{\n",
       "            background-color:  #f8fcbe;\n",
       "            color:  #000000;\n",
       "        }#T_a5008_row1_col1{\n",
       "            background-color:  #b2df90;\n",
       "            color:  #000000;\n",
       "        }#T_a5008_row1_col2,#T_a5008_row4_col0{\n",
       "            background-color:  #69bf72;\n",
       "            color:  #000000;\n",
       "        }#T_a5008_row2_col1{\n",
       "            background-color:  #fcfed4;\n",
       "            color:  #000000;\n",
       "        }#T_a5008_row3_col2{\n",
       "            background-color:  #ceeb9e;\n",
       "            color:  #000000;\n",
       "        }#T_a5008_row4_col1{\n",
       "            background-color:  #1f8142;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_a5008_row4_col2,#T_a5008_row5_col0,#T_a5008_row5_col1{\n",
       "            background-color:  #004529;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_a5008_row5_col2{\n",
       "            background-color:  #006536;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_a5008_row6_col2{\n",
       "            background-color:  #d6efa2;\n",
       "            color:  #000000;\n",
       "        }</style><table id=\"T_a5008_\" ><thead>    <tr>        <th class=\"blank level0\" ></th>        <th class=\"col_heading level0 col0\" >Pure Factors</th>        <th class=\"col_heading level0 col1\" >Bayesian BL</th>        <th class=\"col_heading level0 col2\" >Augmented BL</th>    </tr></thead><tbody>\n",
       "                <tr>\n",
       "                        <th id=\"T_a5008_level0_row0\" class=\"row_heading level0 row0\" >PEP11900D031</th>\n",
       "                        <td id=\"T_a5008_row0_col0\" class=\"data row0 col0\" >0.0000%</td>\n",
       "                        <td id=\"T_a5008_row0_col1\" class=\"data row0 col1\" >0.0000%</td>\n",
       "                        <td id=\"T_a5008_row0_col2\" class=\"data row0 col2\" >6.1659%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_a5008_level0_row1\" class=\"row_heading level0 row1\" >PEP13000D012</th>\n",
       "                        <td id=\"T_a5008_row1_col0\" class=\"data row1 col0\" >6.6666%</td>\n",
       "                        <td id=\"T_a5008_row1_col1\" class=\"data row1 col1\" >16.6284%</td>\n",
       "                        <td id=\"T_a5008_row1_col2\" class=\"data row1 col2\" >16.4517%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_a5008_level0_row2\" class=\"row_heading level0 row2\" >PEP13000M088</th>\n",
       "                        <td id=\"T_a5008_row2_col0\" class=\"data row2 col0\" >0.0000%</td>\n",
       "                        <td id=\"T_a5008_row2_col1\" class=\"data row2 col1\" >2.2787%</td>\n",
       "                        <td id=\"T_a5008_row2_col2\" class=\"data row2 col2\" >5.2876%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_a5008_level0_row3\" class=\"row_heading level0 row3\" >PEP23900M103</th>\n",
       "                        <td id=\"T_a5008_row3_col0\" class=\"data row3 col0\" >0.0000%</td>\n",
       "                        <td id=\"T_a5008_row3_col1\" class=\"data row3 col1\" >0.0000%</td>\n",
       "                        <td id=\"T_a5008_row3_col2\" class=\"data row3 col2\" >11.2159%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_a5008_level0_row4\" class=\"row_heading level0 row4\" >PEP70101M530</th>\n",
       "                        <td id=\"T_a5008_row4_col0\" class=\"data row4 col0\" >32.3836%</td>\n",
       "                        <td id=\"T_a5008_row4_col1\" class=\"data row4 col1\" >35.1621%</td>\n",
       "                        <td id=\"T_a5008_row4_col2\" class=\"data row4 col2\" >26.2782%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_a5008_level0_row5\" class=\"row_heading level0 row5\" >PEP70101M571</th>\n",
       "                        <td id=\"T_a5008_row5_col0\" class=\"data row5 col0\" >60.9498%</td>\n",
       "                        <td id=\"T_a5008_row5_col1\" class=\"data row5 col1\" >45.9306%</td>\n",
       "                        <td id=\"T_a5008_row5_col2\" class=\"data row5 col2\" >23.8401%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_a5008_level0_row6\" class=\"row_heading level0 row6\" >PEP70310M156</th>\n",
       "                        <td id=\"T_a5008_row6_col0\" class=\"data row6 col0\" >0.0000%</td>\n",
       "                        <td id=\"T_a5008_row6_col1\" class=\"data row6 col1\" >0.0000%</td>\n",
       "                        <td id=\"T_a5008_row6_col2\" class=\"data row6 col2\" >10.7607%</td>\n",
       "            </tr>\n",
       "    </tbody></table>"
      ],
      "text/plain": [
       "<pandas.io.formats.style.Styler at 0x7f8d0e6d4f40>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "########################################################################\n",
    "# Calculating optimum portfolios using only Mean Vector\n",
    "# of Black Litterman with Factors and Factor Covariance Matrix\n",
    "########################################################################\n",
    "\n",
    "hist = 2 # False: BL covariance and risk factors scenarios\n",
    "             # True: historical covariance and scenarios\n",
    "             # 2: risk factors covariance and scenarios (Only in BL_FM)\n",
    "\n",
    "# Estimate Portfolio weights using Black Litterman Bayesian Model:\n",
    "port.blfactors_stats(flavor='BLB',\n",
    "                     B=loadings,\n",
    "                     P_f=P_f,\n",
    "                     Q_f=Q_f/252,\n",
    "                     rf=0,\n",
    "                     delta=None,\n",
    "                     eq=True,\n",
    "                     const=False,\n",
    "                     diag=False,\n",
    "                     method_mu=method_mu,\n",
    "                     method_cov=method_cov)\n",
    "\n",
    "w_blb = port.optimization(model='BL_FM', rm=rm, obj=obj, rf=rf, l=l, hist=hist)\n",
    "\n",
    "# Estimate Portfolio weights using Augmented Black Litterman Model:\n",
    "port.blfactors_stats(flavor='ABL',\n",
    "                     B=loadings,\n",
    "                     P_f=P_f,\n",
    "                     Q_f=Q_f/252,\n",
    "                     rf=0,\n",
    "                     delta=None,\n",
    "                     eq=True,\n",
    "                     const=False,\n",
    "                     diag=False,\n",
    "                     method_mu=method_mu,\n",
    "                     method_cov=method_cov)\n",
    "\n",
    "w_abl = port.optimization(model='BL_FM', rm=rm, obj=obj, rf=rf, l=l, hist=hist)\n",
    "\n",
    "ws = pd.concat([w_fm, w_blb, w_abl], axis=1)\n",
    "ws.columns = ['Pure Factors', 'Bayesian BL', 'Augmented BL']\n",
    "\n",
    "display(ws.style.format(\"{:.4%}\").background_gradient(cmap='YlGn'))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can see that when we only use the mean vector of Black Litterman with Factors, the weights that we get are more diversified. Also, we can see that the Augmented Black Litterman creates more diversified portfolios than the Bayesian Black Litterman."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 3. Estimating Mean Variance Portfolio for Equity and Fixed Income Portfolio\n",
    "\n",
    "### 3.1 Building the loadings matrix and risk factors returns.\n",
    "\n",
    "This part shows how to build a personalized loadings matrix that will be used by Riskfolio-Lib to calculate the expected returns and covariance matrix."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<style  type=\"text/css\" >\n",
       "#T_3ae6d_row0_col0,#T_3ae6d_row0_col1,#T_3ae6d_row1_col3,#T_3ae6d_row4_col2,#T_3ae6d_row4_col5,#T_3ae6d_row6_col4{\n",
       "            background-color:  #ffffe5;\n",
       "            color:  #000000;\n",
       "        }#T_3ae6d_row0_col2,#T_3ae6d_row0_col3,#T_3ae6d_row0_col5,#T_3ae6d_row1_col1,#T_3ae6d_row2_col3,#T_3ae6d_row2_col4,#T_3ae6d_row3_col0,#T_3ae6d_row3_col3,#T_3ae6d_row4_col3,#T_3ae6d_row5_col3,#T_3ae6d_row6_col3{\n",
       "            background-color:  #004529;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_3ae6d_row0_col4{\n",
       "            background-color:  #def2a7;\n",
       "            color:  #000000;\n",
       "        }#T_3ae6d_row1_col0,#T_3ae6d_row4_col0{\n",
       "            background-color:  #31974f;\n",
       "            color:  #000000;\n",
       "        }#T_3ae6d_row1_col2{\n",
       "            background-color:  #d3eda0;\n",
       "            color:  #000000;\n",
       "        }#T_3ae6d_row1_col4{\n",
       "            background-color:  #58b669;\n",
       "            color:  #000000;\n",
       "        }#T_3ae6d_row1_col5{\n",
       "            background-color:  #aedd8e;\n",
       "            color:  #000000;\n",
       "        }#T_3ae6d_row2_col0{\n",
       "            background-color:  #3fa95c;\n",
       "            color:  #000000;\n",
       "        }#T_3ae6d_row2_col1{\n",
       "            background-color:  #8dcf81;\n",
       "            color:  #000000;\n",
       "        }#T_3ae6d_row2_col2{\n",
       "            background-color:  #fbfed0;\n",
       "            color:  #000000;\n",
       "        }#T_3ae6d_row2_col5{\n",
       "            background-color:  #ecf7b1;\n",
       "            color:  #000000;\n",
       "        }#T_3ae6d_row3_col1,#T_3ae6d_row4_col1,#T_3ae6d_row5_col1,#T_3ae6d_row6_col1{\n",
       "            background-color:  #187b3f;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_3ae6d_row3_col2{\n",
       "            background-color:  #5cb86b;\n",
       "            color:  #000000;\n",
       "        }#T_3ae6d_row3_col4{\n",
       "            background-color:  #a1d889;\n",
       "            color:  #000000;\n",
       "        }#T_3ae6d_row3_col5{\n",
       "            background-color:  #4fb264;\n",
       "            color:  #000000;\n",
       "        }#T_3ae6d_row4_col4{\n",
       "            background-color:  #00512e;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_3ae6d_row5_col0{\n",
       "            background-color:  #47ae60;\n",
       "            color:  #000000;\n",
       "        }#T_3ae6d_row5_col2{\n",
       "            background-color:  #61bb6d;\n",
       "            color:  #000000;\n",
       "        }#T_3ae6d_row5_col4{\n",
       "            background-color:  #5fba6c;\n",
       "            color:  #000000;\n",
       "        }#T_3ae6d_row5_col5{\n",
       "            background-color:  #c3e698;\n",
       "            color:  #000000;\n",
       "        }#T_3ae6d_row6_col0{\n",
       "            background-color:  #005e33;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_3ae6d_row6_col2{\n",
       "            background-color:  #005730;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_3ae6d_row6_col5{\n",
       "            background-color:  #076d39;\n",
       "            color:  #f1f1f1;\n",
       "        }</style><table id=\"T_3ae6d_\" ><thead>    <tr>        <th class=\"blank level0\" ></th>        <th class=\"col_heading level0 col0\" >const</th>        <th class=\"col_heading level0 col1\" >MTUM</th>        <th class=\"col_heading level0 col2\" >QUAL</th>        <th class=\"col_heading level0 col3\" >SIZE</th>        <th class=\"col_heading level0 col4\" >USMV</th>        <th class=\"col_heading level0 col5\" >VLUE</th>    </tr></thead><tbody>\n",
       "                <tr>\n",
       "                        <th id=\"T_3ae6d_level0_row0\" class=\"row_heading level0 row0\" >APA</th>\n",
       "                        <td id=\"T_3ae6d_row0_col0\" class=\"data row0 col0\" >-0.0008</td>\n",
       "                        <td id=\"T_3ae6d_row0_col1\" class=\"data row0 col1\" >-0.8999</td>\n",
       "                        <td id=\"T_3ae6d_row0_col2\" class=\"data row0 col2\" >1.2674</td>\n",
       "                        <td id=\"T_3ae6d_row0_col3\" class=\"data row0 col3\" >0.0000</td>\n",
       "                        <td id=\"T_3ae6d_row0_col4\" class=\"data row0 col4\" >-0.5750</td>\n",
       "                        <td id=\"T_3ae6d_row0_col5\" class=\"data row0 col5\" >1.4874</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_3ae6d_level0_row1\" class=\"row_heading level0 row1\" >CMCSA</th>\n",
       "                        <td id=\"T_3ae6d_row1_col0\" class=\"data row1 col0\" >-0.0000</td>\n",
       "                        <td id=\"T_3ae6d_row1_col1\" class=\"data row1 col1\" >0.2426</td>\n",
       "                        <td id=\"T_3ae6d_row1_col2\" class=\"data row1 col2\" >0.0000</td>\n",
       "                        <td id=\"T_3ae6d_row1_col3\" class=\"data row1 col3\" >-0.1569</td>\n",
       "                        <td id=\"T_3ae6d_row1_col4\" class=\"data row1 col4\" >0.5483</td>\n",
       "                        <td id=\"T_3ae6d_row1_col5\" class=\"data row1 col5\" >0.3623</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_3ae6d_level0_row2\" class=\"row_heading level0 row2\" >CNP</th>\n",
       "                        <td id=\"T_3ae6d_row2_col0\" class=\"data row2 col0\" >-0.0001</td>\n",
       "                        <td id=\"T_3ae6d_row2_col1\" class=\"data row2 col1\" >-0.3827</td>\n",
       "                        <td id=\"T_3ae6d_row2_col2\" class=\"data row2 col2\" >-0.3579</td>\n",
       "                        <td id=\"T_3ae6d_row2_col3\" class=\"data row2 col3\" >0.0000</td>\n",
       "                        <td id=\"T_3ae6d_row2_col4\" class=\"data row2 col4\" >1.9556</td>\n",
       "                        <td id=\"T_3ae6d_row2_col5\" class=\"data row2 col5\" >0.0000</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_3ae6d_level0_row3\" class=\"row_heading level0 row3\" >HPQ</th>\n",
       "                        <td id=\"T_3ae6d_row3_col0\" class=\"data row3 col0\" >0.0003</td>\n",
       "                        <td id=\"T_3ae6d_row3_col1\" class=\"data row3 col1\" >0.0000</td>\n",
       "                        <td id=\"T_3ae6d_row3_col2\" class=\"data row3 col2\" >0.5164</td>\n",
       "                        <td id=\"T_3ae6d_row3_col3\" class=\"data row3 col3\" >0.0000</td>\n",
       "                        <td id=\"T_3ae6d_row3_col4\" class=\"data row3 col4\" >0.0000</td>\n",
       "                        <td id=\"T_3ae6d_row3_col5\" class=\"data row3 col5\" >0.7550</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_3ae6d_level0_row4\" class=\"row_heading level0 row4\" >PSA</th>\n",
       "                        <td id=\"T_3ae6d_row4_col0\" class=\"data row4 col0\" >-0.0000</td>\n",
       "                        <td id=\"T_3ae6d_row4_col1\" class=\"data row4 col1\" >0.0000</td>\n",
       "                        <td id=\"T_3ae6d_row4_col2\" class=\"data row4 col2\" >-0.4623</td>\n",
       "                        <td id=\"T_3ae6d_row4_col3\" class=\"data row4 col3\" >0.0000</td>\n",
       "                        <td id=\"T_3ae6d_row4_col4\" class=\"data row4 col4\" >1.8071</td>\n",
       "                        <td id=\"T_3ae6d_row4_col5\" class=\"data row4 col5\" >-0.3115</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_3ae6d_level0_row5\" class=\"row_heading level0 row5\" >SEE</th>\n",
       "                        <td id=\"T_3ae6d_row5_col0\" class=\"data row5 col0\" >-0.0001</td>\n",
       "                        <td id=\"T_3ae6d_row5_col1\" class=\"data row5 col1\" >0.0000</td>\n",
       "                        <td id=\"T_3ae6d_row5_col2\" class=\"data row5 col2\" >0.4915</td>\n",
       "                        <td id=\"T_3ae6d_row5_col3\" class=\"data row5 col3\" >0.0000</td>\n",
       "                        <td id=\"T_3ae6d_row5_col4\" class=\"data row5 col4\" >0.5043</td>\n",
       "                        <td id=\"T_3ae6d_row5_col5\" class=\"data row5 col5\" >0.2535</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_3ae6d_level0_row6\" class=\"row_heading level0 row6\" >ZION</th>\n",
       "                        <td id=\"T_3ae6d_row6_col0\" class=\"data row6 col0\" >0.0002</td>\n",
       "                        <td id=\"T_3ae6d_row6_col1\" class=\"data row6 col1\" >0.0000</td>\n",
       "                        <td id=\"T_3ae6d_row6_col2\" class=\"data row6 col2\" >1.1589</td>\n",
       "                        <td id=\"T_3ae6d_row6_col3\" class=\"data row6 col3\" >0.0000</td>\n",
       "                        <td id=\"T_3ae6d_row6_col4\" class=\"data row6 col4\" >-1.3203</td>\n",
       "                        <td id=\"T_3ae6d_row6_col5\" class=\"data row6 col5\" >1.2202</td>\n",
       "            </tr>\n",
       "    </tbody></table>"
      ],
      "text/plain": [
       "<pandas.io.formats.style.Styler at 0x7f8d0e6e2760>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import riskfolio.ParamsEstimation as pe\n",
    "\n",
    "B = pe.loadings_matrix(factors_returns, assets_returns[equity])\n",
    "\n",
    "display(B.style.format(\"{:.4f}\").background_gradient(cmap='YlGn'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>APA</th>\n",
       "      <th>CMCSA</th>\n",
       "      <th>CNP</th>\n",
       "      <th>HPQ</th>\n",
       "      <th>PSA</th>\n",
       "      <th>SEE</th>\n",
       "      <th>ZION</th>\n",
       "      <th>PEP11900D031</th>\n",
       "      <th>PEP13000D012</th>\n",
       "      <th>PEP13000M088</th>\n",
       "      <th>PEP23900M103</th>\n",
       "      <th>PEP70101M530</th>\n",
       "      <th>PEP70101M571</th>\n",
       "      <th>PEP70310M156</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2017-11-16</th>\n",
       "      <td>-0.013161</td>\n",
       "      <td>-0.002958</td>\n",
       "      <td>-0.010903</td>\n",
       "      <td>0.009831</td>\n",
       "      <td>0.017234</td>\n",
       "      <td>0.014016</td>\n",
       "      <td>-0.008387</td>\n",
       "      <td>-0.000411</td>\n",
       "      <td>-0.000380</td>\n",
       "      <td>-0.000597</td>\n",
       "      <td>-0.000737</td>\n",
       "      <td>-0.000116</td>\n",
       "      <td>0.000076</td>\n",
       "      <td>-0.000633</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017-11-15</th>\n",
       "      <td>-0.020296</td>\n",
       "      <td>0.008682</td>\n",
       "      <td>-0.011202</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>-0.013479</td>\n",
       "      <td>-0.003326</td>\n",
       "      <td>0.000215</td>\n",
       "      <td>-0.001626</td>\n",
       "      <td>-0.003076</td>\n",
       "      <td>-0.003041</td>\n",
       "      <td>-0.002286</td>\n",
       "      <td>-0.004459</td>\n",
       "      <td>-0.004651</td>\n",
       "      <td>-0.002146</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017-11-14</th>\n",
       "      <td>-0.037020</td>\n",
       "      <td>-0.010470</td>\n",
       "      <td>0.010800</td>\n",
       "      <td>0.008975</td>\n",
       "      <td>-0.001548</td>\n",
       "      <td>0.002668</td>\n",
       "      <td>0.026950</td>\n",
       "      <td>0.002320</td>\n",
       "      <td>0.000236</td>\n",
       "      <td>0.001040</td>\n",
       "      <td>0.002373</td>\n",
       "      <td>-0.002741</td>\n",
       "      <td>-0.003932</td>\n",
       "      <td>0.002151</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017-11-13</th>\n",
       "      <td>-0.014503</td>\n",
       "      <td>0.010855</td>\n",
       "      <td>0.007480</td>\n",
       "      <td>-0.002826</td>\n",
       "      <td>0.008179</td>\n",
       "      <td>0.014205</td>\n",
       "      <td>0.034145</td>\n",
       "      <td>0.000906</td>\n",
       "      <td>0.000064</td>\n",
       "      <td>-0.000767</td>\n",
       "      <td>0.000354</td>\n",
       "      <td>-0.000835</td>\n",
       "      <td>-0.001114</td>\n",
       "      <td>-0.000081</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017-11-10</th>\n",
       "      <td>-0.024536</td>\n",
       "      <td>0.007932</td>\n",
       "      <td>-0.013418</td>\n",
       "      <td>-0.005155</td>\n",
       "      <td>0.000710</td>\n",
       "      <td>-0.009381</td>\n",
       "      <td>-0.000910</td>\n",
       "      <td>0.001194</td>\n",
       "      <td>0.003792</td>\n",
       "      <td>0.003047</td>\n",
       "      <td>0.001355</td>\n",
       "      <td>0.007118</td>\n",
       "      <td>0.008207</td>\n",
       "      <td>-0.000090</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                 APA     CMCSA       CNP       HPQ       PSA       SEE  \\\n",
       "Date                                                                     \n",
       "2017-11-16 -0.013161 -0.002958 -0.010903  0.009831  0.017234  0.014016   \n",
       "2017-11-15 -0.020296  0.008682 -0.011202  0.000000 -0.013479 -0.003326   \n",
       "2017-11-14 -0.037020 -0.010470  0.010800  0.008975 -0.001548  0.002668   \n",
       "2017-11-13 -0.014503  0.010855  0.007480 -0.002826  0.008179  0.014205   \n",
       "2017-11-10 -0.024536  0.007932 -0.013418 -0.005155  0.000710 -0.009381   \n",
       "\n",
       "                ZION  PEP11900D031  PEP13000D012  PEP13000M088  PEP23900M103  \\\n",
       "Date                                                                           \n",
       "2017-11-16 -0.008387     -0.000411     -0.000380     -0.000597     -0.000737   \n",
       "2017-11-15  0.000215     -0.001626     -0.003076     -0.003041     -0.002286   \n",
       "2017-11-14  0.026950      0.002320      0.000236      0.001040      0.002373   \n",
       "2017-11-13  0.034145      0.000906      0.000064     -0.000767      0.000354   \n",
       "2017-11-10 -0.000910      0.001194      0.003792      0.003047      0.001355   \n",
       "\n",
       "            PEP70101M530  PEP70101M571  PEP70310M156  \n",
       "Date                                                  \n",
       "2017-11-16     -0.000116      0.000076     -0.000633  \n",
       "2017-11-15     -0.004459     -0.004651     -0.002146  \n",
       "2017-11-14     -0.002741     -0.003932      0.002151  \n",
       "2017-11-13     -0.000835     -0.001114     -0.000081  \n",
       "2017-11-10      0.007118      0.008207     -0.000090  "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "########################################################################\n",
    "# Building the asset returns matrix\n",
    "########################################################################\n",
    "\n",
    "Y = pd.concat([assets_returns[equity], Y], axis=1)\n",
    "\n",
    "display(Y.head())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>MTUM</th>\n",
       "      <th>QUAL</th>\n",
       "      <th>SIZE</th>\n",
       "      <th>USMV</th>\n",
       "      <th>VLUE</th>\n",
       "      <th>R 0</th>\n",
       "      <th>R 90</th>\n",
       "      <th>R 180</th>\n",
       "      <th>R 360</th>\n",
       "      <th>R 720</th>\n",
       "      <th>...</th>\n",
       "      <th>R 10800</th>\n",
       "      <th>R^2 0</th>\n",
       "      <th>R^2 90</th>\n",
       "      <th>R^2 180</th>\n",
       "      <th>R^2 360</th>\n",
       "      <th>R^2 720</th>\n",
       "      <th>R^2 1800</th>\n",
       "      <th>R^2 3600</th>\n",
       "      <th>R^2 7200</th>\n",
       "      <th>R^2 10800</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2017-11-16</th>\n",
       "      <td>0.009478</td>\n",
       "      <td>0.007556</td>\n",
       "      <td>0.006675</td>\n",
       "      <td>0.006408</td>\n",
       "      <td>0.014509</td>\n",
       "      <td>0.00000</td>\n",
       "      <td>0.000059</td>\n",
       "      <td>0.000108</td>\n",
       "      <td>0.000178</td>\n",
       "      <td>0.000246</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.000093</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>3.527647e-09</td>\n",
       "      <td>1.163831e-08</td>\n",
       "      <td>3.181621e-08</td>\n",
       "      <td>6.048648e-08</td>\n",
       "      <td>4.552420e-08</td>\n",
       "      <td>5.573518e-09</td>\n",
       "      <td>2.314283e-09</td>\n",
       "      <td>8.695936e-09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017-11-15</th>\n",
       "      <td>-0.003381</td>\n",
       "      <td>-0.005884</td>\n",
       "      <td>-0.001974</td>\n",
       "      <td>-0.006750</td>\n",
       "      <td>-0.003771</td>\n",
       "      <td>0.00018</td>\n",
       "      <td>0.000247</td>\n",
       "      <td>0.000303</td>\n",
       "      <td>0.000391</td>\n",
       "      <td>0.000495</td>\n",
       "      <td>...</td>\n",
       "      <td>0.000417</td>\n",
       "      <td>3.225005e-08</td>\n",
       "      <td>6.082093e-08</td>\n",
       "      <td>9.197391e-08</td>\n",
       "      <td>1.529780e-07</td>\n",
       "      <td>2.448864e-07</td>\n",
       "      <td>3.108575e-07</td>\n",
       "      <td>2.620815e-07</td>\n",
       "      <td>2.025117e-07</td>\n",
       "      <td>1.736147e-07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017-11-14</th>\n",
       "      <td>-0.001687</td>\n",
       "      <td>0.000375</td>\n",
       "      <td>-0.000370</td>\n",
       "      <td>0.001932</td>\n",
       "      <td>-0.004380</td>\n",
       "      <td>-0.00180</td>\n",
       "      <td>-0.001710</td>\n",
       "      <td>-0.001624</td>\n",
       "      <td>-0.001460</td>\n",
       "      <td>-0.001167</td>\n",
       "      <td>...</td>\n",
       "      <td>0.000861</td>\n",
       "      <td>3.241235e-06</td>\n",
       "      <td>2.925701e-06</td>\n",
       "      <td>2.636999e-06</td>\n",
       "      <td>2.131988e-06</td>\n",
       "      <td>1.362113e-06</td>\n",
       "      <td>2.555747e-07</td>\n",
       "      <td>1.966922e-08</td>\n",
       "      <td>4.572289e-07</td>\n",
       "      <td>7.417774e-07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017-11-13</th>\n",
       "      <td>0.002488</td>\n",
       "      <td>0.000877</td>\n",
       "      <td>0.003589</td>\n",
       "      <td>0.003296</td>\n",
       "      <td>0.000751</td>\n",
       "      <td>0.00000</td>\n",
       "      <td>0.000013</td>\n",
       "      <td>0.000025</td>\n",
       "      <td>0.000048</td>\n",
       "      <td>0.000088</td>\n",
       "      <td>...</td>\n",
       "      <td>0.000364</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>1.681950e-10</td>\n",
       "      <td>6.400900e-10</td>\n",
       "      <td>2.324301e-09</td>\n",
       "      <td>7.748577e-09</td>\n",
       "      <td>3.033345e-08</td>\n",
       "      <td>6.657174e-08</td>\n",
       "      <td>1.116368e-07</td>\n",
       "      <td>1.328391e-07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017-11-10</th>\n",
       "      <td>0.002894</td>\n",
       "      <td>0.001255</td>\n",
       "      <td>-0.001730</td>\n",
       "      <td>-0.000968</td>\n",
       "      <td>0.001254</td>\n",
       "      <td>0.00000</td>\n",
       "      <td>0.000026</td>\n",
       "      <td>0.000043</td>\n",
       "      <td>0.000054</td>\n",
       "      <td>0.000017</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.001054</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>6.770924e-10</td>\n",
       "      <td>1.820644e-09</td>\n",
       "      <td>2.881542e-09</td>\n",
       "      <td>2.791573e-10</td>\n",
       "      <td>6.131368e-08</td>\n",
       "      <td>3.779975e-07</td>\n",
       "      <td>8.759856e-07</td>\n",
       "      <td>1.110697e-06</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 23 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                MTUM      QUAL      SIZE      USMV      VLUE      R 0  \\\n",
       "Date                                                                    \n",
       "2017-11-16  0.009478  0.007556  0.006675  0.006408  0.014509  0.00000   \n",
       "2017-11-15 -0.003381 -0.005884 -0.001974 -0.006750 -0.003771  0.00018   \n",
       "2017-11-14 -0.001687  0.000375 -0.000370  0.001932 -0.004380 -0.00180   \n",
       "2017-11-13  0.002488  0.000877  0.003589  0.003296  0.000751  0.00000   \n",
       "2017-11-10  0.002894  0.001255 -0.001730 -0.000968  0.001254  0.00000   \n",
       "\n",
       "                R 90     R 180     R 360     R 720  ...   R 10800  \\\n",
       "Date                                                ...             \n",
       "2017-11-16  0.000059  0.000108  0.000178  0.000246  ... -0.000093   \n",
       "2017-11-15  0.000247  0.000303  0.000391  0.000495  ...  0.000417   \n",
       "2017-11-14 -0.001710 -0.001624 -0.001460 -0.001167  ...  0.000861   \n",
       "2017-11-13  0.000013  0.000025  0.000048  0.000088  ...  0.000364   \n",
       "2017-11-10  0.000026  0.000043  0.000054  0.000017  ... -0.001054   \n",
       "\n",
       "                   R^2 0        R^2 90       R^2 180       R^2 360  \\\n",
       "Date                                                                 \n",
       "2017-11-16  0.000000e+00  3.527647e-09  1.163831e-08  3.181621e-08   \n",
       "2017-11-15  3.225005e-08  6.082093e-08  9.197391e-08  1.529780e-07   \n",
       "2017-11-14  3.241235e-06  2.925701e-06  2.636999e-06  2.131988e-06   \n",
       "2017-11-13  0.000000e+00  1.681950e-10  6.400900e-10  2.324301e-09   \n",
       "2017-11-10  0.000000e+00  6.770924e-10  1.820644e-09  2.881542e-09   \n",
       "\n",
       "                 R^2 720      R^2 1800      R^2 3600      R^2 7200  \\\n",
       "Date                                                                 \n",
       "2017-11-16  6.048648e-08  4.552420e-08  5.573518e-09  2.314283e-09   \n",
       "2017-11-15  2.448864e-07  3.108575e-07  2.620815e-07  2.025117e-07   \n",
       "2017-11-14  1.362113e-06  2.555747e-07  1.966922e-08  4.572289e-07   \n",
       "2017-11-13  7.748577e-09  3.033345e-08  6.657174e-08  1.116368e-07   \n",
       "2017-11-10  2.791573e-10  6.131368e-08  3.779975e-07  8.759856e-07   \n",
       "\n",
       "               R^2 10800  \n",
       "Date                      \n",
       "2017-11-16  8.695936e-09  \n",
       "2017-11-15  1.736147e-07  \n",
       "2017-11-14  7.417774e-07  \n",
       "2017-11-13  1.328391e-07  \n",
       "2017-11-10  1.110697e-06  \n",
       "\n",
       "[5 rows x 23 columns]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "########################################################################\n",
    "# Building the asset returns matrix\n",
    "########################################################################\n",
    "\n",
    "X = pd.concat([factors_returns, X], axis=1)\n",
    "\n",
    "display(X.head())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<style  type=\"text/css\" >\n",
       "#T_08329_row0_col0,#T_08329_row0_col1,#T_08329_row0_col15,#T_08329_row0_col16,#T_08329_row0_col17,#T_08329_row0_col18,#T_08329_row0_col19,#T_08329_row0_col20,#T_08329_row0_col21,#T_08329_row0_col22,#T_08329_row0_col23,#T_08329_row1_col3,#T_08329_row1_col15,#T_08329_row1_col16,#T_08329_row1_col17,#T_08329_row1_col18,#T_08329_row1_col19,#T_08329_row1_col20,#T_08329_row1_col21,#T_08329_row1_col22,#T_08329_row1_col23,#T_08329_row2_col15,#T_08329_row2_col16,#T_08329_row2_col17,#T_08329_row2_col18,#T_08329_row2_col19,#T_08329_row2_col20,#T_08329_row2_col21,#T_08329_row2_col22,#T_08329_row2_col23,#T_08329_row3_col15,#T_08329_row3_col16,#T_08329_row3_col17,#T_08329_row3_col18,#T_08329_row3_col19,#T_08329_row3_col20,#T_08329_row3_col21,#T_08329_row3_col22,#T_08329_row3_col23,#T_08329_row4_col2,#T_08329_row4_col5,#T_08329_row4_col15,#T_08329_row4_col16,#T_08329_row4_col17,#T_08329_row4_col18,#T_08329_row4_col19,#T_08329_row4_col20,#T_08329_row4_col21,#T_08329_row4_col22,#T_08329_row4_col23,#T_08329_row5_col15,#T_08329_row5_col16,#T_08329_row5_col17,#T_08329_row5_col18,#T_08329_row5_col19,#T_08329_row5_col20,#T_08329_row5_col21,#T_08329_row5_col22,#T_08329_row5_col23,#T_08329_row6_col4,#T_08329_row6_col15,#T_08329_row6_col16,#T_08329_row6_col17,#T_08329_row6_col18,#T_08329_row6_col19,#T_08329_row6_col20,#T_08329_row6_col21,#T_08329_row6_col22,#T_08329_row6_col23,#T_08329_row7_col8,#T_08329_row7_col9,#T_08329_row7_col10,#T_08329_row7_col21,#T_08329_row7_col22,#T_08329_row7_col23,#T_08329_row8_col7,#T_08329_row8_col15,#T_08329_row8_col22,#T_08329_row8_col23,#T_08329_row9_col22,#T_08329_row9_col23,#T_08329_row10_col11,#T_08329_row10_col15,#T_08329_row10_col21,#T_08329_row10_col22,#T_08329_row10_col23,#T_08329_row11_col12,#T_08329_row11_col15,#T_08329_row11_col23,#T_08329_row12_col6,#T_08329_row12_col13,#T_08329_row12_col14,#T_08329_row13_col15,#T_08329_row13_col21,#T_08329_row13_col22,#T_08329_row13_col23{\n",
       "            background-color:  #ffffe5;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row0_col2,#T_08329_row0_col3,#T_08329_row0_col5,#T_08329_row0_col6,#T_08329_row0_col7,#T_08329_row0_col8,#T_08329_row0_col9,#T_08329_row0_col10,#T_08329_row0_col11,#T_08329_row0_col12,#T_08329_row0_col13,#T_08329_row0_col14,#T_08329_row1_col1,#T_08329_row1_col6,#T_08329_row1_col7,#T_08329_row1_col8,#T_08329_row1_col9,#T_08329_row1_col10,#T_08329_row1_col11,#T_08329_row1_col12,#T_08329_row1_col13,#T_08329_row1_col14,#T_08329_row2_col3,#T_08329_row2_col4,#T_08329_row2_col6,#T_08329_row2_col7,#T_08329_row2_col8,#T_08329_row2_col9,#T_08329_row2_col10,#T_08329_row2_col11,#T_08329_row2_col12,#T_08329_row2_col13,#T_08329_row2_col14,#T_08329_row3_col0,#T_08329_row3_col3,#T_08329_row3_col6,#T_08329_row3_col7,#T_08329_row3_col8,#T_08329_row3_col9,#T_08329_row3_col10,#T_08329_row3_col11,#T_08329_row3_col12,#T_08329_row3_col13,#T_08329_row3_col14,#T_08329_row4_col3,#T_08329_row4_col6,#T_08329_row4_col7,#T_08329_row4_col8,#T_08329_row4_col9,#T_08329_row4_col10,#T_08329_row4_col11,#T_08329_row4_col12,#T_08329_row4_col13,#T_08329_row4_col14,#T_08329_row5_col3,#T_08329_row5_col6,#T_08329_row5_col7,#T_08329_row5_col8,#T_08329_row5_col9,#T_08329_row5_col10,#T_08329_row5_col11,#T_08329_row5_col12,#T_08329_row5_col13,#T_08329_row5_col14,#T_08329_row6_col3,#T_08329_row6_col6,#T_08329_row6_col7,#T_08329_row6_col8,#T_08329_row6_col9,#T_08329_row6_col10,#T_08329_row6_col11,#T_08329_row6_col12,#T_08329_row6_col13,#T_08329_row6_col14,#T_08329_row7_col3,#T_08329_row7_col12,#T_08329_row7_col13,#T_08329_row7_col14,#T_08329_row7_col18,#T_08329_row7_col19,#T_08329_row8_col3,#T_08329_row8_col6,#T_08329_row8_col14,#T_08329_row8_col16,#T_08329_row8_col21,#T_08329_row9_col3,#T_08329_row9_col13,#T_08329_row9_col14,#T_08329_row9_col15,#T_08329_row9_col17,#T_08329_row10_col3,#T_08329_row10_col6,#T_08329_row10_col13,#T_08329_row10_col14,#T_08329_row10_col20,#T_08329_row11_col3,#T_08329_row11_col6,#T_08329_row11_col14,#T_08329_row12_col3,#T_08329_row12_col22,#T_08329_row12_col23,#T_08329_row13_col3,#T_08329_row13_col6,#T_08329_row13_col12,#T_08329_row13_col13,#T_08329_row13_col14{\n",
       "            background-color:  #004529;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_08329_row0_col4{\n",
       "            background-color:  #def2a7;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row1_col0,#T_08329_row4_col0,#T_08329_row12_col18{\n",
       "            background-color:  #31974f;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row1_col2,#T_08329_row7_col2,#T_08329_row8_col2,#T_08329_row9_col2,#T_08329_row10_col2,#T_08329_row11_col2,#T_08329_row12_col2,#T_08329_row13_col2{\n",
       "            background-color:  #d3eda0;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row1_col4{\n",
       "            background-color:  #58b669;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row1_col5,#T_08329_row9_col12{\n",
       "            background-color:  #aedd8e;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row2_col0{\n",
       "            background-color:  #3fa95c;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row2_col1,#T_08329_row12_col21{\n",
       "            background-color:  #8dcf81;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row2_col2{\n",
       "            background-color:  #fbfed0;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row2_col5,#T_08329_row7_col5,#T_08329_row8_col5,#T_08329_row9_col5,#T_08329_row10_col5,#T_08329_row11_col5,#T_08329_row12_col5,#T_08329_row13_col5{\n",
       "            background-color:  #ecf7b1;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row3_col1,#T_08329_row4_col1,#T_08329_row5_col1,#T_08329_row6_col1,#T_08329_row7_col1,#T_08329_row8_col1,#T_08329_row9_col1,#T_08329_row10_col1,#T_08329_row11_col1,#T_08329_row12_col1,#T_08329_row13_col1{\n",
       "            background-color:  #187b3f;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_08329_row3_col2,#T_08329_row7_col16,#T_08329_row12_col16{\n",
       "            background-color:  #5cb86b;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row3_col4,#T_08329_row7_col4,#T_08329_row8_col4,#T_08329_row9_col4,#T_08329_row10_col4,#T_08329_row11_col4,#T_08329_row12_col4,#T_08329_row13_col4{\n",
       "            background-color:  #a1d889;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row3_col5{\n",
       "            background-color:  #4fb264;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row4_col4{\n",
       "            background-color:  #00512e;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_08329_row5_col0{\n",
       "            background-color:  #47ae60;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row5_col2{\n",
       "            background-color:  #61bb6d;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row5_col4{\n",
       "            background-color:  #5fba6c;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row5_col5,#T_08329_row9_col9,#T_08329_row12_col9{\n",
       "            background-color:  #c3e698;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row6_col0{\n",
       "            background-color:  #005e33;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_08329_row6_col2{\n",
       "            background-color:  #005730;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_08329_row6_col5{\n",
       "            background-color:  #076d39;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_08329_row7_col0,#T_08329_row7_col20,#T_08329_row8_col0,#T_08329_row9_col0,#T_08329_row10_col0,#T_08329_row11_col0,#T_08329_row12_col0,#T_08329_row13_col0{\n",
       "            background-color:  #2e924c;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row7_col6{\n",
       "            background-color:  #e2f4aa;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row7_col7,#T_08329_row11_col17{\n",
       "            background-color:  #d2eda0;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row7_col11,#T_08329_row12_col10{\n",
       "            background-color:  #ddf2a6;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row7_col15{\n",
       "            background-color:  #b9e294;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row7_col17{\n",
       "            background-color:  #016937;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_08329_row8_col8,#T_08329_row11_col22{\n",
       "            background-color:  #d5eea1;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row8_col9{\n",
       "            background-color:  #f0f9b4;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row8_col10{\n",
       "            background-color:  #f9fdc4;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row8_col11{\n",
       "            background-color:  #298c48;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row8_col12,#T_08329_row13_col11{\n",
       "            background-color:  #feffde;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row8_col13,#T_08329_row13_col20{\n",
       "            background-color:  #004e2d;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_08329_row8_col17,#T_08329_row13_col16{\n",
       "            background-color:  #b1df90;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row8_col18{\n",
       "            background-color:  #11753d;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_08329_row8_col19,#T_08329_row10_col7{\n",
       "            background-color:  #005830;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_08329_row8_col20{\n",
       "            background-color:  #e4f4ab;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row9_col6{\n",
       "            background-color:  #f7fcb9;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row9_col7{\n",
       "            background-color:  #00522e;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_08329_row9_col8{\n",
       "            background-color:  #ddf1a6;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row9_col10{\n",
       "            background-color:  #daf0a4;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row9_col11,#T_08329_row10_col10{\n",
       "            background-color:  #abdc8d;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row9_col16{\n",
       "            background-color:  #feffe1;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row9_col18,#T_08329_row9_col19{\n",
       "            background-color:  #167a3f;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_08329_row9_col20{\n",
       "            background-color:  #a2d88a;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row9_col21{\n",
       "            background-color:  #b2df90;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row10_col8{\n",
       "            background-color:  #a7db8c;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row10_col9{\n",
       "            background-color:  #90d083;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row10_col12{\n",
       "            background-color:  #004629;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_08329_row10_col16{\n",
       "            background-color:  #ffffe4;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row10_col17{\n",
       "            background-color:  #12763d;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_08329_row10_col18{\n",
       "            background-color:  #30954f;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row10_col19,#T_08329_row12_col17{\n",
       "            background-color:  #379e54;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row11_col7,#T_08329_row11_col10{\n",
       "            background-color:  #bee596;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row11_col8,#T_08329_row12_col12{\n",
       "            background-color:  #83cb7d;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row11_col9{\n",
       "            background-color:  #a4d98a;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row11_col11{\n",
       "            background-color:  #1a7d40;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_08329_row11_col13{\n",
       "            background-color:  #9dd688;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row11_col16{\n",
       "            background-color:  #39a056;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row11_col18{\n",
       "            background-color:  #4ab062;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row11_col19{\n",
       "            background-color:  #2c8f4b;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row11_col20{\n",
       "            background-color:  #edf8b1;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row11_col21{\n",
       "            background-color:  #086e3a;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_08329_row12_col7,#T_08329_row13_col8{\n",
       "            background-color:  #79c679;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row12_col8{\n",
       "            background-color:  #b8e293;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row12_col11{\n",
       "            background-color:  #248644;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row12_col15{\n",
       "            background-color:  #89ce80;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row12_col19{\n",
       "            background-color:  #13773d;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_08329_row12_col20{\n",
       "            background-color:  #e7f6ad;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row13_col7{\n",
       "            background-color:  #77c679;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row13_col9{\n",
       "            background-color:  #8ed082;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row13_col10{\n",
       "            background-color:  #cbea9c;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row13_col17{\n",
       "            background-color:  #c4e799;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row13_col18{\n",
       "            background-color:  #56b568;\n",
       "            color:  #000000;\n",
       "        }#T_08329_row13_col19{\n",
       "            background-color:  #3ca458;\n",
       "            color:  #000000;\n",
       "        }</style><table id=\"T_08329_\" ><thead>    <tr>        <th class=\"blank level0\" ></th>        <th class=\"col_heading level0 col0\" >const</th>        <th class=\"col_heading level0 col1\" >MTUM</th>        <th class=\"col_heading level0 col2\" >QUAL</th>        <th class=\"col_heading level0 col3\" >SIZE</th>        <th class=\"col_heading level0 col4\" >USMV</th>        <th class=\"col_heading level0 col5\" >VLUE</th>        <th class=\"col_heading level0 col6\" >R 0</th>        <th class=\"col_heading level0 col7\" >R 90</th>        <th class=\"col_heading level0 col8\" >R 180</th>        <th class=\"col_heading level0 col9\" >R 360</th>        <th class=\"col_heading level0 col10\" >R 720</th>        <th class=\"col_heading level0 col11\" >R 1800</th>        <th class=\"col_heading level0 col12\" >R 3600</th>        <th class=\"col_heading level0 col13\" >R 7200</th>        <th class=\"col_heading level0 col14\" >R 10800</th>        <th class=\"col_heading level0 col15\" >R^2 0</th>        <th class=\"col_heading level0 col16\" >R^2 90</th>        <th class=\"col_heading level0 col17\" >R^2 180</th>        <th class=\"col_heading level0 col18\" >R^2 360</th>        <th class=\"col_heading level0 col19\" >R^2 720</th>        <th class=\"col_heading level0 col20\" >R^2 1800</th>        <th class=\"col_heading level0 col21\" >R^2 3600</th>        <th class=\"col_heading level0 col22\" >R^2 7200</th>        <th class=\"col_heading level0 col23\" >R^2 10800</th>    </tr></thead><tbody>\n",
       "                <tr>\n",
       "                        <th id=\"T_08329_level0_row0\" class=\"row_heading level0 row0\" >APA</th>\n",
       "                        <td id=\"T_08329_row0_col0\" class=\"data row0 col0\" >-0.0008</td>\n",
       "                        <td id=\"T_08329_row0_col1\" class=\"data row0 col1\" >-0.8999</td>\n",
       "                        <td id=\"T_08329_row0_col2\" class=\"data row0 col2\" >1.2674</td>\n",
       "                        <td id=\"T_08329_row0_col3\" class=\"data row0 col3\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row0_col4\" class=\"data row0 col4\" >-0.5750</td>\n",
       "                        <td id=\"T_08329_row0_col5\" class=\"data row0 col5\" >1.4874</td>\n",
       "                        <td id=\"T_08329_row0_col6\" class=\"data row0 col6\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row0_col7\" class=\"data row0 col7\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row0_col8\" class=\"data row0 col8\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row0_col9\" class=\"data row0 col9\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row0_col10\" class=\"data row0 col10\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row0_col11\" class=\"data row0 col11\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row0_col12\" class=\"data row0 col12\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row0_col13\" class=\"data row0 col13\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row0_col14\" class=\"data row0 col14\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row0_col15\" class=\"data row0 col15\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row0_col16\" class=\"data row0 col16\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row0_col17\" class=\"data row0 col17\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row0_col18\" class=\"data row0 col18\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row0_col19\" class=\"data row0 col19\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row0_col20\" class=\"data row0 col20\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row0_col21\" class=\"data row0 col21\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row0_col22\" class=\"data row0 col22\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row0_col23\" class=\"data row0 col23\" >0.0000</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_08329_level0_row1\" class=\"row_heading level0 row1\" >CMCSA</th>\n",
       "                        <td id=\"T_08329_row1_col0\" class=\"data row1 col0\" >-0.0000</td>\n",
       "                        <td id=\"T_08329_row1_col1\" class=\"data row1 col1\" >0.2426</td>\n",
       "                        <td id=\"T_08329_row1_col2\" class=\"data row1 col2\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row1_col3\" class=\"data row1 col3\" >-0.1569</td>\n",
       "                        <td id=\"T_08329_row1_col4\" class=\"data row1 col4\" >0.5483</td>\n",
       "                        <td id=\"T_08329_row1_col5\" class=\"data row1 col5\" >0.3623</td>\n",
       "                        <td id=\"T_08329_row1_col6\" class=\"data row1 col6\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row1_col7\" class=\"data row1 col7\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row1_col8\" class=\"data row1 col8\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row1_col9\" class=\"data row1 col9\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row1_col10\" class=\"data row1 col10\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row1_col11\" class=\"data row1 col11\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row1_col12\" class=\"data row1 col12\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row1_col13\" class=\"data row1 col13\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row1_col14\" class=\"data row1 col14\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row1_col15\" class=\"data row1 col15\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row1_col16\" class=\"data row1 col16\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row1_col17\" class=\"data row1 col17\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row1_col18\" class=\"data row1 col18\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row1_col19\" class=\"data row1 col19\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row1_col20\" class=\"data row1 col20\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row1_col21\" class=\"data row1 col21\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row1_col22\" class=\"data row1 col22\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row1_col23\" class=\"data row1 col23\" >0.0000</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_08329_level0_row2\" class=\"row_heading level0 row2\" >CNP</th>\n",
       "                        <td id=\"T_08329_row2_col0\" class=\"data row2 col0\" >-0.0001</td>\n",
       "                        <td id=\"T_08329_row2_col1\" class=\"data row2 col1\" >-0.3827</td>\n",
       "                        <td id=\"T_08329_row2_col2\" class=\"data row2 col2\" >-0.3579</td>\n",
       "                        <td id=\"T_08329_row2_col3\" class=\"data row2 col3\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row2_col4\" class=\"data row2 col4\" >1.9556</td>\n",
       "                        <td id=\"T_08329_row2_col5\" class=\"data row2 col5\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row2_col6\" class=\"data row2 col6\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row2_col7\" class=\"data row2 col7\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row2_col8\" class=\"data row2 col8\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row2_col9\" class=\"data row2 col9\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row2_col10\" class=\"data row2 col10\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row2_col11\" class=\"data row2 col11\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row2_col12\" class=\"data row2 col12\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row2_col13\" class=\"data row2 col13\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row2_col14\" class=\"data row2 col14\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row2_col15\" class=\"data row2 col15\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row2_col16\" class=\"data row2 col16\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row2_col17\" class=\"data row2 col17\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row2_col18\" class=\"data row2 col18\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row2_col19\" class=\"data row2 col19\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row2_col20\" class=\"data row2 col20\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row2_col21\" class=\"data row2 col21\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row2_col22\" class=\"data row2 col22\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row2_col23\" class=\"data row2 col23\" >0.0000</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_08329_level0_row3\" class=\"row_heading level0 row3\" >HPQ</th>\n",
       "                        <td id=\"T_08329_row3_col0\" class=\"data row3 col0\" >0.0003</td>\n",
       "                        <td id=\"T_08329_row3_col1\" class=\"data row3 col1\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row3_col2\" class=\"data row3 col2\" >0.5164</td>\n",
       "                        <td id=\"T_08329_row3_col3\" class=\"data row3 col3\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row3_col4\" class=\"data row3 col4\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row3_col5\" class=\"data row3 col5\" >0.7550</td>\n",
       "                        <td id=\"T_08329_row3_col6\" class=\"data row3 col6\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row3_col7\" class=\"data row3 col7\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row3_col8\" class=\"data row3 col8\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row3_col9\" class=\"data row3 col9\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row3_col10\" class=\"data row3 col10\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row3_col11\" class=\"data row3 col11\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row3_col12\" class=\"data row3 col12\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row3_col13\" class=\"data row3 col13\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row3_col14\" class=\"data row3 col14\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row3_col15\" class=\"data row3 col15\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row3_col16\" class=\"data row3 col16\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row3_col17\" class=\"data row3 col17\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row3_col18\" class=\"data row3 col18\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row3_col19\" class=\"data row3 col19\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row3_col20\" class=\"data row3 col20\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row3_col21\" class=\"data row3 col21\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row3_col22\" class=\"data row3 col22\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row3_col23\" class=\"data row3 col23\" >0.0000</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_08329_level0_row4\" class=\"row_heading level0 row4\" >PSA</th>\n",
       "                        <td id=\"T_08329_row4_col0\" class=\"data row4 col0\" >-0.0000</td>\n",
       "                        <td id=\"T_08329_row4_col1\" class=\"data row4 col1\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row4_col2\" class=\"data row4 col2\" >-0.4623</td>\n",
       "                        <td id=\"T_08329_row4_col3\" class=\"data row4 col3\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row4_col4\" class=\"data row4 col4\" >1.8071</td>\n",
       "                        <td id=\"T_08329_row4_col5\" class=\"data row4 col5\" >-0.3115</td>\n",
       "                        <td id=\"T_08329_row4_col6\" class=\"data row4 col6\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row4_col7\" class=\"data row4 col7\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row4_col8\" class=\"data row4 col8\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row4_col9\" class=\"data row4 col9\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row4_col10\" class=\"data row4 col10\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row4_col11\" class=\"data row4 col11\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row4_col12\" class=\"data row4 col12\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row4_col13\" class=\"data row4 col13\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row4_col14\" class=\"data row4 col14\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row4_col15\" class=\"data row4 col15\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row4_col16\" class=\"data row4 col16\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row4_col17\" class=\"data row4 col17\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row4_col18\" class=\"data row4 col18\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row4_col19\" class=\"data row4 col19\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row4_col20\" class=\"data row4 col20\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row4_col21\" class=\"data row4 col21\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row4_col22\" class=\"data row4 col22\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row4_col23\" class=\"data row4 col23\" >0.0000</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_08329_level0_row5\" class=\"row_heading level0 row5\" >SEE</th>\n",
       "                        <td id=\"T_08329_row5_col0\" class=\"data row5 col0\" >-0.0001</td>\n",
       "                        <td id=\"T_08329_row5_col1\" class=\"data row5 col1\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row5_col2\" class=\"data row5 col2\" >0.4915</td>\n",
       "                        <td id=\"T_08329_row5_col3\" class=\"data row5 col3\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row5_col4\" class=\"data row5 col4\" >0.5043</td>\n",
       "                        <td id=\"T_08329_row5_col5\" class=\"data row5 col5\" >0.2535</td>\n",
       "                        <td id=\"T_08329_row5_col6\" class=\"data row5 col6\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row5_col7\" class=\"data row5 col7\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row5_col8\" class=\"data row5 col8\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row5_col9\" class=\"data row5 col9\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row5_col10\" class=\"data row5 col10\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row5_col11\" class=\"data row5 col11\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row5_col12\" class=\"data row5 col12\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row5_col13\" class=\"data row5 col13\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row5_col14\" class=\"data row5 col14\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row5_col15\" class=\"data row5 col15\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row5_col16\" class=\"data row5 col16\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row5_col17\" class=\"data row5 col17\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row5_col18\" class=\"data row5 col18\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row5_col19\" class=\"data row5 col19\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row5_col20\" class=\"data row5 col20\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row5_col21\" class=\"data row5 col21\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row5_col22\" class=\"data row5 col22\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row5_col23\" class=\"data row5 col23\" >0.0000</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_08329_level0_row6\" class=\"row_heading level0 row6\" >ZION</th>\n",
       "                        <td id=\"T_08329_row6_col0\" class=\"data row6 col0\" >0.0002</td>\n",
       "                        <td id=\"T_08329_row6_col1\" class=\"data row6 col1\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row6_col2\" class=\"data row6 col2\" >1.1589</td>\n",
       "                        <td id=\"T_08329_row6_col3\" class=\"data row6 col3\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row6_col4\" class=\"data row6 col4\" >-1.3203</td>\n",
       "                        <td id=\"T_08329_row6_col5\" class=\"data row6 col5\" >1.2202</td>\n",
       "                        <td id=\"T_08329_row6_col6\" class=\"data row6 col6\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row6_col7\" class=\"data row6 col7\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row6_col8\" class=\"data row6 col8\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row6_col9\" class=\"data row6 col9\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row6_col10\" class=\"data row6 col10\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row6_col11\" class=\"data row6 col11\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row6_col12\" class=\"data row6 col12\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row6_col13\" class=\"data row6 col13\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row6_col14\" class=\"data row6 col14\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row6_col15\" class=\"data row6 col15\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row6_col16\" class=\"data row6 col16\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row6_col17\" class=\"data row6 col17\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row6_col18\" class=\"data row6 col18\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row6_col19\" class=\"data row6 col19\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row6_col20\" class=\"data row6 col20\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row6_col21\" class=\"data row6 col21\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row6_col22\" class=\"data row6 col22\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row6_col23\" class=\"data row6 col23\" >0.0000</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_08329_level0_row7\" class=\"row_heading level0 row7\" >PEP11900D031</th>\n",
       "                        <td id=\"T_08329_row7_col0\" class=\"data row7 col0\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row7_col1\" class=\"data row7 col1\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row7_col2\" class=\"data row7 col2\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row7_col3\" class=\"data row7 col3\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row7_col4\" class=\"data row7 col4\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row7_col5\" class=\"data row7 col5\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row7_col6\" class=\"data row7 col6\" >-0.0012</td>\n",
       "                        <td id=\"T_08329_row7_col7\" class=\"data row7 col7\" >-0.0057</td>\n",
       "                        <td id=\"T_08329_row7_col8\" class=\"data row7 col8\" >-0.0192</td>\n",
       "                        <td id=\"T_08329_row7_col9\" class=\"data row7 col9\" >-0.0730</td>\n",
       "                        <td id=\"T_08329_row7_col10\" class=\"data row7 col10\" >-0.3685</td>\n",
       "                        <td id=\"T_08329_row7_col11\" class=\"data row7 col11\" >-3.0416</td>\n",
       "                        <td id=\"T_08329_row7_col12\" class=\"data row7 col12\" >-0.0030</td>\n",
       "                        <td id=\"T_08329_row7_col13\" class=\"data row7 col13\" >-0.0000</td>\n",
       "                        <td id=\"T_08329_row7_col14\" class=\"data row7 col14\" >-0.0000</td>\n",
       "                        <td id=\"T_08329_row7_col15\" class=\"data row7 col15\" >0.0002</td>\n",
       "                        <td id=\"T_08329_row7_col16\" class=\"data row7 col16\" >0.0016</td>\n",
       "                        <td id=\"T_08329_row7_col17\" class=\"data row7 col17\" >0.0083</td>\n",
       "                        <td id=\"T_08329_row7_col18\" class=\"data row7 col18\" >0.0464</td>\n",
       "                        <td id=\"T_08329_row7_col19\" class=\"data row7 col19\" >0.3871</td>\n",
       "                        <td id=\"T_08329_row7_col20\" class=\"data row7 col20\" >7.7809</td>\n",
       "                        <td id=\"T_08329_row7_col21\" class=\"data row7 col21\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row7_col22\" class=\"data row7 col22\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row7_col23\" class=\"data row7 col23\" >0.0000</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_08329_level0_row8\" class=\"row_heading level0 row8\" >PEP13000D012</th>\n",
       "                        <td id=\"T_08329_row8_col0\" class=\"data row8 col0\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row8_col1\" class=\"data row8 col1\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row8_col2\" class=\"data row8 col2\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row8_col3\" class=\"data row8 col3\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row8_col4\" class=\"data row8 col4\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row8_col5\" class=\"data row8 col5\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row8_col6\" class=\"data row8 col6\" >-0.0000</td>\n",
       "                        <td id=\"T_08329_row8_col7\" class=\"data row8 col7\" >-0.0078</td>\n",
       "                        <td id=\"T_08329_row8_col8\" class=\"data row8 col8\" >-0.0142</td>\n",
       "                        <td id=\"T_08329_row8_col9\" class=\"data row8 col9\" >-0.0617</td>\n",
       "                        <td id=\"T_08329_row8_col10\" class=\"data row8 col10\" >-0.3327</td>\n",
       "                        <td id=\"T_08329_row8_col11\" class=\"data row8 col11\" >-1.0902</td>\n",
       "                        <td id=\"T_08329_row8_col12\" class=\"data row8 col12\" >-4.8055</td>\n",
       "                        <td id=\"T_08329_row8_col13\" class=\"data row8 col13\" >-0.2074</td>\n",
       "                        <td id=\"T_08329_row8_col14\" class=\"data row8 col14\" >-0.0000</td>\n",
       "                        <td id=\"T_08329_row8_col15\" class=\"data row8 col15\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row8_col16\" class=\"data row8 col16\" >0.0029</td>\n",
       "                        <td id=\"T_08329_row8_col17\" class=\"data row8 col17\" >0.0035</td>\n",
       "                        <td id=\"T_08329_row8_col18\" class=\"data row8 col18\" >0.0378</td>\n",
       "                        <td id=\"T_08329_row8_col19\" class=\"data row8 col19\" >0.3605</td>\n",
       "                        <td id=\"T_08329_row8_col20\" class=\"data row8 col20\" >2.2492</td>\n",
       "                        <td id=\"T_08329_row8_col21\" class=\"data row8 col21\" >22.6080</td>\n",
       "                        <td id=\"T_08329_row8_col22\" class=\"data row8 col22\" >0.0553</td>\n",
       "                        <td id=\"T_08329_row8_col23\" class=\"data row8 col23\" >0.0000</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_08329_level0_row9\" class=\"row_heading level0 row9\" >PEP13000M088</th>\n",
       "                        <td id=\"T_08329_row9_col0\" class=\"data row9 col0\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row9_col1\" class=\"data row9 col1\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row9_col2\" class=\"data row9 col2\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row9_col3\" class=\"data row9 col3\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row9_col4\" class=\"data row9 col4\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row9_col5\" class=\"data row9 col5\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row9_col6\" class=\"data row9 col6\" >-0.0013</td>\n",
       "                        <td id=\"T_08329_row9_col7\" class=\"data row9 col7\" >-0.0004</td>\n",
       "                        <td id=\"T_08329_row9_col8\" class=\"data row9 col8\" >-0.0147</td>\n",
       "                        <td id=\"T_08329_row9_col9\" class=\"data row9 col9\" >-0.0501</td>\n",
       "                        <td id=\"T_08329_row9_col10\" class=\"data row9 col10\" >-0.2770</td>\n",
       "                        <td id=\"T_08329_row9_col11\" class=\"data row9 col11\" >-2.4626</td>\n",
       "                        <td id=\"T_08329_row9_col12\" class=\"data row9 col12\" >-3.0764</td>\n",
       "                        <td id=\"T_08329_row9_col13\" class=\"data row9 col13\" >-0.0000</td>\n",
       "                        <td id=\"T_08329_row9_col14\" class=\"data row9 col14\" >-0.0000</td>\n",
       "                        <td id=\"T_08329_row9_col15\" class=\"data row9 col15\" >0.0005</td>\n",
       "                        <td id=\"T_08329_row9_col16\" class=\"data row9 col16\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row9_col17\" class=\"data row9 col17\" >0.0096</td>\n",
       "                        <td id=\"T_08329_row9_col18\" class=\"data row9 col18\" >0.0368</td>\n",
       "                        <td id=\"T_08329_row9_col19\" class=\"data row9 col19\" >0.3081</td>\n",
       "                        <td id=\"T_08329_row9_col20\" class=\"data row9 col20\" >4.4240</td>\n",
       "                        <td id=\"T_08329_row9_col21\" class=\"data row9 col21\" >8.1440</td>\n",
       "                        <td id=\"T_08329_row9_col22\" class=\"data row9 col22\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row9_col23\" class=\"data row9 col23\" >0.0000</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_08329_level0_row10\" class=\"row_heading level0 row10\" >PEP23900M103</th>\n",
       "                        <td id=\"T_08329_row10_col0\" class=\"data row10 col0\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row10_col1\" class=\"data row10 col1\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row10_col2\" class=\"data row10 col2\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row10_col3\" class=\"data row10 col3\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row10_col4\" class=\"data row10 col4\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row10_col5\" class=\"data row10 col5\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row10_col6\" class=\"data row10 col6\" >-0.0000</td>\n",
       "                        <td id=\"T_08329_row10_col7\" class=\"data row10 col7\" >-0.0005</td>\n",
       "                        <td id=\"T_08329_row10_col8\" class=\"data row10 col8\" >-0.0117</td>\n",
       "                        <td id=\"T_08329_row10_col9\" class=\"data row10 col9\" >-0.0405</td>\n",
       "                        <td id=\"T_08329_row10_col10\" class=\"data row10 col10\" >-0.2274</td>\n",
       "                        <td id=\"T_08329_row10_col11\" class=\"data row10 col11\" >-3.9726</td>\n",
       "                        <td id=\"T_08329_row10_col12\" class=\"data row10 col12\" >-0.0381</td>\n",
       "                        <td id=\"T_08329_row10_col13\" class=\"data row10 col13\" >-0.0000</td>\n",
       "                        <td id=\"T_08329_row10_col14\" class=\"data row10 col14\" >-0.0000</td>\n",
       "                        <td id=\"T_08329_row10_col15\" class=\"data row10 col15\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row10_col16\" class=\"data row10 col16\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row10_col17\" class=\"data row10 col17\" >0.0078</td>\n",
       "                        <td id=\"T_08329_row10_col18\" class=\"data row10 col18\" >0.0322</td>\n",
       "                        <td id=\"T_08329_row10_col19\" class=\"data row10 col19\" >0.2581</td>\n",
       "                        <td id=\"T_08329_row10_col20\" class=\"data row10 col20\" >11.0636</td>\n",
       "                        <td id=\"T_08329_row10_col21\" class=\"data row10 col21\" >0.0011</td>\n",
       "                        <td id=\"T_08329_row10_col22\" class=\"data row10 col22\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row10_col23\" class=\"data row10 col23\" >0.0000</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_08329_level0_row11\" class=\"row_heading level0 row11\" >PEP70101M530</th>\n",
       "                        <td id=\"T_08329_row11_col0\" class=\"data row11 col0\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row11_col1\" class=\"data row11 col1\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row11_col2\" class=\"data row11 col2\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row11_col3\" class=\"data row11 col3\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row11_col4\" class=\"data row11 col4\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row11_col5\" class=\"data row11 col5\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row11_col6\" class=\"data row11 col6\" >-0.0000</td>\n",
       "                        <td id=\"T_08329_row11_col7\" class=\"data row11 col7\" >-0.0052</td>\n",
       "                        <td id=\"T_08329_row11_col8\" class=\"data row11 col8\" >-0.0101</td>\n",
       "                        <td id=\"T_08329_row11_col9\" class=\"data row11 col9\" >-0.0442</td>\n",
       "                        <td id=\"T_08329_row11_col10\" class=\"data row11 col10\" >-0.2488</td>\n",
       "                        <td id=\"T_08329_row11_col11\" class=\"data row11 col11\" >-0.8826</td>\n",
       "                        <td id=\"T_08329_row11_col12\" class=\"data row11 col12\" >-4.9147</td>\n",
       "                        <td id=\"T_08329_row11_col13\" class=\"data row11 col13\" >-3.5537</td>\n",
       "                        <td id=\"T_08329_row11_col14\" class=\"data row11 col14\" >-0.0000</td>\n",
       "                        <td id=\"T_08329_row11_col15\" class=\"data row11 col15\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row11_col16\" class=\"data row11 col16\" >0.0019</td>\n",
       "                        <td id=\"T_08329_row11_col17\" class=\"data row11 col17\" >0.0026</td>\n",
       "                        <td id=\"T_08329_row11_col18\" class=\"data row11 col18\" >0.0280</td>\n",
       "                        <td id=\"T_08329_row11_col19\" class=\"data row11 col19\" >0.2765</td>\n",
       "                        <td id=\"T_08329_row11_col20\" class=\"data row11 col20\" >1.8686</td>\n",
       "                        <td id=\"T_08329_row11_col21\" class=\"data row11 col21\" >19.1157</td>\n",
       "                        <td id=\"T_08329_row11_col22\" class=\"data row11 col22\" >13.0732</td>\n",
       "                        <td id=\"T_08329_row11_col23\" class=\"data row11 col23\" >0.0000</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_08329_level0_row12\" class=\"row_heading level0 row12\" >PEP70101M571</th>\n",
       "                        <td id=\"T_08329_row12_col0\" class=\"data row12 col0\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row12_col1\" class=\"data row12 col1\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row12_col2\" class=\"data row12 col2\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row12_col3\" class=\"data row12 col3\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row12_col4\" class=\"data row12 col4\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row12_col5\" class=\"data row12 col5\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row12_col6\" class=\"data row12 col6\" >-0.0015</td>\n",
       "                        <td id=\"T_08329_row12_col7\" class=\"data row12 col7\" >-0.0039</td>\n",
       "                        <td id=\"T_08329_row12_col8\" class=\"data row12 col8\" >-0.0126</td>\n",
       "                        <td id=\"T_08329_row12_col9\" class=\"data row12 col9\" >-0.0501</td>\n",
       "                        <td id=\"T_08329_row12_col10\" class=\"data row12 col10\" >-0.2829</td>\n",
       "                        <td id=\"T_08329_row12_col11\" class=\"data row12 col11\" >-1.0108</td>\n",
       "                        <td id=\"T_08329_row12_col12\" class=\"data row12 col12\" >-2.5878</td>\n",
       "                        <td id=\"T_08329_row12_col13\" class=\"data row12 col13\" >-6.0312</td>\n",
       "                        <td id=\"T_08329_row12_col14\" class=\"data row12 col14\" >-0.4501</td>\n",
       "                        <td id=\"T_08329_row12_col15\" class=\"data row12 col15\" >0.0002</td>\n",
       "                        <td id=\"T_08329_row12_col16\" class=\"data row12 col16\" >0.0016</td>\n",
       "                        <td id=\"T_08329_row12_col17\" class=\"data row12 col17\" >0.0064</td>\n",
       "                        <td id=\"T_08329_row12_col18\" class=\"data row12 col18\" >0.0319</td>\n",
       "                        <td id=\"T_08329_row12_col19\" class=\"data row12 col19\" >0.3123</td>\n",
       "                        <td id=\"T_08329_row12_col20\" class=\"data row12 col20\" >2.1336</td>\n",
       "                        <td id=\"T_08329_row12_col21\" class=\"data row12 col21\" >10.1632</td>\n",
       "                        <td id=\"T_08329_row12_col22\" class=\"data row12 col22\" >49.9021</td>\n",
       "                        <td id=\"T_08329_row12_col23\" class=\"data row12 col23\" >0.4523</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_08329_level0_row13\" class=\"row_heading level0 row13\" >PEP70310M156</th>\n",
       "                        <td id=\"T_08329_row13_col0\" class=\"data row13 col0\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row13_col1\" class=\"data row13 col1\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row13_col2\" class=\"data row13 col2\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row13_col3\" class=\"data row13 col3\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row13_col4\" class=\"data row13 col4\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row13_col5\" class=\"data row13 col5\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row13_col6\" class=\"data row13 col6\" >-0.0000</td>\n",
       "                        <td id=\"T_08329_row13_col7\" class=\"data row13 col7\" >-0.0039</td>\n",
       "                        <td id=\"T_08329_row13_col8\" class=\"data row13 col8\" >-0.0097</td>\n",
       "                        <td id=\"T_08329_row13_col9\" class=\"data row13 col9\" >-0.0403</td>\n",
       "                        <td id=\"T_08329_row13_col10\" class=\"data row13 col10\" >-0.2614</td>\n",
       "                        <td id=\"T_08329_row13_col11\" class=\"data row13 col11\" >-3.8920</td>\n",
       "                        <td id=\"T_08329_row13_col12\" class=\"data row13 col12\" >-0.0000</td>\n",
       "                        <td id=\"T_08329_row13_col13\" class=\"data row13 col13\" >-0.0000</td>\n",
       "                        <td id=\"T_08329_row13_col14\" class=\"data row13 col14\" >-0.0000</td>\n",
       "                        <td id=\"T_08329_row13_col15\" class=\"data row13 col15\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row13_col16\" class=\"data row13 col16\" >0.0010</td>\n",
       "                        <td id=\"T_08329_row13_col17\" class=\"data row13 col17\" >0.0030</td>\n",
       "                        <td id=\"T_08329_row13_col18\" class=\"data row13 col18\" >0.0268</td>\n",
       "                        <td id=\"T_08329_row13_col19\" class=\"data row13 col19\" >0.2508</td>\n",
       "                        <td id=\"T_08329_row13_col20\" class=\"data row13 col20\" >10.6813</td>\n",
       "                        <td id=\"T_08329_row13_col21\" class=\"data row13 col21\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row13_col22\" class=\"data row13 col22\" >0.0000</td>\n",
       "                        <td id=\"T_08329_row13_col23\" class=\"data row13 col23\" >0.0000</td>\n",
       "            </tr>\n",
       "    </tbody></table>"
      ],
      "text/plain": [
       "<pandas.io.formats.style.Styler at 0x7f8d0a5f0a90>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "########################################################################\n",
    "# Building The Loadings Matrix\n",
    "########################################################################\n",
    "\n",
    "loadings = pd.concat([B, loadings], axis = 1)\n",
    "loadings.fillna(0, inplace=True)\n",
    "\n",
    "display(loadings.style.format(\"{:.4f}\").background_gradient(cmap='YlGn'))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 3.2 Building views on risk factors"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "MTUM    0.154379\n",
       "QUAL    0.113842\n",
       "SIZE    0.115915\n",
       "USMV    0.124555\n",
       "VLUE    0.106612\n",
       "dtype: float64"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "########################################################################\n",
    "# Showing annualized returns of Equity Risk Factors\n",
    "########################################################################\n",
    "\n",
    "display(factors_returns.mean()*252)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Disabled</th>\n",
       "      <th>Factor</th>\n",
       "      <th>Sign</th>\n",
       "      <th>Value</th>\n",
       "      <th>Relative Factor</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>False</td>\n",
       "      <td>MTUM</td>\n",
       "      <td>&gt;=</td>\n",
       "      <td>0.020</td>\n",
       "      <td>VLUE</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>False</td>\n",
       "      <td>USMV</td>\n",
       "      <td>&gt;=</td>\n",
       "      <td>0.090</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>False</td>\n",
       "      <td>SIZE</td>\n",
       "      <td>&gt;=</td>\n",
       "      <td>0.120</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>False</td>\n",
       "      <td>R 10800</td>\n",
       "      <td>&gt;=</td>\n",
       "      <td>0.001</td>\n",
       "      <td>R 90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>False</td>\n",
       "      <td>R 1800</td>\n",
       "      <td>&lt;=</td>\n",
       "      <td>-0.001</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>False</td>\n",
       "      <td>R 3600</td>\n",
       "      <td>&lt;=</td>\n",
       "      <td>-0.003</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Disabled   Factor Sign  Value Relative Factor\n",
       "0     False     MTUM   >=  0.020            VLUE\n",
       "1     False     USMV   >=  0.090                \n",
       "2     False     SIZE   >=  0.120                \n",
       "3     False  R 10800   >=  0.001            R 90\n",
       "4     False   R 1800   <= -0.001                \n",
       "5     False   R 3600   <= -0.003                "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "########################################################################\n",
    "# Building views on some Risk Factors\n",
    "########################################################################\n",
    "\n",
    "views = {'Disabled': [False, False, False, False, False, False],\n",
    "        'Factor': ['MTUM','USMV','SIZE','R 10800','R 1800','R 3600'],\n",
    "        'Sign': ['>=', '>=', '>=', '>=', '<=', '<='],\n",
    "        'Value': [0.02, 0.09, 0.12, 0.001, -0.001, -0.003],\n",
    "        'Relative Factor': ['VLUE', '', '','R 90', '', '']}\n",
    "views = pd.DataFrame(views)\n",
    "\n",
    "display(views)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Matrix of factors views P_f\n",
      "[[ 1  0  0  0 -1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0]\n",
      " [ 0  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0 -1  0  0  0  0  0  0  1  0  0  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0  0  0  0  0 -1  0  0  0  0  0  0  0  0  0  0  0  0]\n",
      " [ 0  0  0  0  0  0  0  0  0  0  0 -1  0  0  0  0  0  0  0  0  0  0  0]]\n",
      "\n",
      "Matrix of returns of factors views Q_f\n",
      "[[0.02 ]\n",
      " [0.09 ]\n",
      " [0.12 ]\n",
      " [0.001]\n",
      " [0.001]\n",
      " [0.003]]\n"
     ]
    }
   ],
   "source": [
    "########################################################################\n",
    "# Building views matrixes P_f and Q_f\n",
    "########################################################################\n",
    "\n",
    "P_f, Q_f = cf.factors_views(views, loadings, const=True)\n",
    "\n",
    "print('Matrix of factors views P_f')\n",
    "print(P_f)\n",
    "print('\\nMatrix of returns of factors views Q_f')\n",
    "print(Q_f)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 3.3 Building Portfolios with mean vector and covariance matrix from Black Litterman with Factors."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "########################################################################\n",
    "# Building Portfolio Object\n",
    "########################################################################\n",
    "\n",
    "# Building the portfolio object\n",
    "port = pf.Portfolio(returns=Y)\n",
    "\n",
    "# Calculating optimum portfolio\n",
    "\n",
    "# Select method and estimate input parameters:\n",
    "\n",
    "method_mu='hist' # Method to estimate expected returns based on historical data.\n",
    "method_cov='hist' # Method to estimate covariance matrix based on historical data.\n",
    "\n",
    "port.assets_stats(method_mu=method_mu,\n",
    "                  method_cov=method_cov,\n",
    "                  d=0.94)\n",
    "\n",
    "port.factors = X\n",
    "port.factors_stats(method_mu=method_mu,\n",
    "                   method_cov=method_cov,\n",
    "                   d=0.94,\n",
    "                   B=loadings,\n",
    "                   const=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "You must convert self.cov_bl_fm to a positive definite matrix\n",
      "You must convert self.cov_bl_fm to a positive definite matrix\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/danycajas/opt/anaconda3/lib/python3.8/site-packages/statsmodels/stats/moment_helpers.py:251: RuntimeWarning: invalid value encountered in sqrt\n",
      "  std_ = np.sqrt(np.diag(cov))\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<style  type=\"text/css\" >\n",
       "#T_222c1_row0_col0,#T_222c1_row0_col1,#T_222c1_row0_col2,#T_222c1_row1_col1,#T_222c1_row1_col2,#T_222c1_row2_col1,#T_222c1_row2_col2,#T_222c1_row4_col2,#T_222c1_row5_col0,#T_222c1_row5_col1,#T_222c1_row5_col2,#T_222c1_row6_col1,#T_222c1_row6_col2,#T_222c1_row7_col0,#T_222c1_row7_col2,#T_222c1_row8_col0,#T_222c1_row8_col1,#T_222c1_row9_col0,#T_222c1_row9_col1,#T_222c1_row9_col2,#T_222c1_row10_col0,#T_222c1_row10_col1,#T_222c1_row10_col2,#T_222c1_row11_col1,#T_222c1_row11_col2,#T_222c1_row12_col1,#T_222c1_row12_col2,#T_222c1_row13_col0,#T_222c1_row13_col1,#T_222c1_row13_col2{\n",
       "            background-color:  #ffffe5;\n",
       "            color:  #000000;\n",
       "        }#T_222c1_row1_col0{\n",
       "            background-color:  #9fd788;\n",
       "            color:  #000000;\n",
       "        }#T_222c1_row2_col0{\n",
       "            background-color:  #84cb7e;\n",
       "            color:  #000000;\n",
       "        }#T_222c1_row3_col0{\n",
       "            background-color:  #40aa5c;\n",
       "            color:  #000000;\n",
       "        }#T_222c1_row3_col1,#T_222c1_row3_col2,#T_222c1_row4_col0{\n",
       "            background-color:  #004529;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_222c1_row4_col1{\n",
       "            background-color:  #f9fdc4;\n",
       "            color:  #000000;\n",
       "        }#T_222c1_row6_col0{\n",
       "            background-color:  #c5e89a;\n",
       "            color:  #000000;\n",
       "        }#T_222c1_row7_col1{\n",
       "            background-color:  #248644;\n",
       "            color:  #000000;\n",
       "        }#T_222c1_row8_col2{\n",
       "            background-color:  #aedd8e;\n",
       "            color:  #000000;\n",
       "        }#T_222c1_row11_col0{\n",
       "            background-color:  #c8e99b;\n",
       "            color:  #000000;\n",
       "        }#T_222c1_row12_col0{\n",
       "            background-color:  #2a8d49;\n",
       "            color:  #000000;\n",
       "        }</style><table id=\"T_222c1_\" ><thead>    <tr>        <th class=\"blank level0\" ></th>        <th class=\"col_heading level0 col0\" >Pure Factors</th>        <th class=\"col_heading level0 col1\" >Bayesian BL</th>        <th class=\"col_heading level0 col2\" >Augmented BL</th>    </tr></thead><tbody>\n",
       "                <tr>\n",
       "                        <th id=\"T_222c1_level0_row0\" class=\"row_heading level0 row0\" >APA</th>\n",
       "                        <td id=\"T_222c1_row0_col0\" class=\"data row0 col0\" >0.0000%</td>\n",
       "                        <td id=\"T_222c1_row0_col1\" class=\"data row0 col1\" >0.0000%</td>\n",
       "                        <td id=\"T_222c1_row0_col2\" class=\"data row0 col2\" >0.0000%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_222c1_level0_row1\" class=\"row_heading level0 row1\" >CMCSA</th>\n",
       "                        <td id=\"T_222c1_row1_col0\" class=\"data row1 col0\" >10.6667%</td>\n",
       "                        <td id=\"T_222c1_row1_col1\" class=\"data row1 col1\" >0.0000%</td>\n",
       "                        <td id=\"T_222c1_row1_col2\" class=\"data row1 col2\" >0.0000%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_222c1_level0_row2\" class=\"row_heading level0 row2\" >CNP</th>\n",
       "                        <td id=\"T_222c1_row2_col0\" class=\"data row2 col0\" >12.2571%</td>\n",
       "                        <td id=\"T_222c1_row2_col1\" class=\"data row2 col1\" >0.0000%</td>\n",
       "                        <td id=\"T_222c1_row2_col2\" class=\"data row2 col2\" >0.0000%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_222c1_level0_row3\" class=\"row_heading level0 row3\" >HPQ</th>\n",
       "                        <td id=\"T_222c1_row3_col0\" class=\"data row3 col0\" >16.3689%</td>\n",
       "                        <td id=\"T_222c1_row3_col1\" class=\"data row3 col1\" >54.3495%</td>\n",
       "                        <td id=\"T_222c1_row3_col2\" class=\"data row3 col2\" >72.8467%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_222c1_level0_row4\" class=\"row_heading level0 row4\" >PSA</th>\n",
       "                        <td id=\"T_222c1_row4_col0\" class=\"data row4 col0\" >26.0443%</td>\n",
       "                        <td id=\"T_222c1_row4_col1\" class=\"data row4 col1\" >5.2034%</td>\n",
       "                        <td id=\"T_222c1_row4_col2\" class=\"data row4 col2\" >0.0000%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_222c1_level0_row5\" class=\"row_heading level0 row5\" >SEE</th>\n",
       "                        <td id=\"T_222c1_row5_col0\" class=\"data row5 col0\" >0.0767%</td>\n",
       "                        <td id=\"T_222c1_row5_col1\" class=\"data row5 col1\" >0.0000%</td>\n",
       "                        <td id=\"T_222c1_row5_col2\" class=\"data row5 col2\" >0.0000%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_222c1_level0_row6\" class=\"row_heading level0 row6\" >ZION</th>\n",
       "                        <td id=\"T_222c1_row6_col0\" class=\"data row6 col0\" >7.9948%</td>\n",
       "                        <td id=\"T_222c1_row6_col1\" class=\"data row6 col1\" >0.0000%</td>\n",
       "                        <td id=\"T_222c1_row6_col2\" class=\"data row6 col2\" >0.0000%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_222c1_level0_row7\" class=\"row_heading level0 row7\" >PEP11900D031</th>\n",
       "                        <td id=\"T_222c1_row7_col0\" class=\"data row7 col0\" >0.0000%</td>\n",
       "                        <td id=\"T_222c1_row7_col1\" class=\"data row7 col1\" >40.4471%</td>\n",
       "                        <td id=\"T_222c1_row7_col2\" class=\"data row7 col2\" >0.0000%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_222c1_level0_row8\" class=\"row_heading level0 row8\" >PEP13000D012</th>\n",
       "                        <td id=\"T_222c1_row8_col0\" class=\"data row8 col0\" >0.0000%</td>\n",
       "                        <td id=\"T_222c1_row8_col1\" class=\"data row8 col1\" >0.0000%</td>\n",
       "                        <td id=\"T_222c1_row8_col2\" class=\"data row8 col2\" >27.1529%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_222c1_level0_row9\" class=\"row_heading level0 row9\" >PEP13000M088</th>\n",
       "                        <td id=\"T_222c1_row9_col0\" class=\"data row9 col0\" >0.0000%</td>\n",
       "                        <td id=\"T_222c1_row9_col1\" class=\"data row9 col1\" >0.0000%</td>\n",
       "                        <td id=\"T_222c1_row9_col2\" class=\"data row9 col2\" >0.0000%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_222c1_level0_row10\" class=\"row_heading level0 row10\" >PEP23900M103</th>\n",
       "                        <td id=\"T_222c1_row10_col0\" class=\"data row10 col0\" >0.0000%</td>\n",
       "                        <td id=\"T_222c1_row10_col1\" class=\"data row10 col1\" >0.0000%</td>\n",
       "                        <td id=\"T_222c1_row10_col2\" class=\"data row10 col2\" >0.0000%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_222c1_level0_row11\" class=\"row_heading level0 row11\" >PEP70101M530</th>\n",
       "                        <td id=\"T_222c1_row11_col0\" class=\"data row11 col0\" >7.8240%</td>\n",
       "                        <td id=\"T_222c1_row11_col1\" class=\"data row11 col1\" >0.0000%</td>\n",
       "                        <td id=\"T_222c1_row11_col2\" class=\"data row11 col2\" >0.0002%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_222c1_level0_row12\" class=\"row_heading level0 row12\" >PEP70101M571</th>\n",
       "                        <td id=\"T_222c1_row12_col0\" class=\"data row12 col0\" >18.7674%</td>\n",
       "                        <td id=\"T_222c1_row12_col1\" class=\"data row12 col1\" >0.0000%</td>\n",
       "                        <td id=\"T_222c1_row12_col2\" class=\"data row12 col2\" >0.0000%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_222c1_level0_row13\" class=\"row_heading level0 row13\" >PEP70310M156</th>\n",
       "                        <td id=\"T_222c1_row13_col0\" class=\"data row13 col0\" >0.0000%</td>\n",
       "                        <td id=\"T_222c1_row13_col1\" class=\"data row13 col1\" >0.0000%</td>\n",
       "                        <td id=\"T_222c1_row13_col2\" class=\"data row13 col2\" >0.0000%</td>\n",
       "            </tr>\n",
       "    </tbody></table>"
      ],
      "text/plain": [
       "<pandas.io.formats.style.Styler at 0x7f8d0e852c40>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "########################################################################\n",
    "# Calculating optimum portfolios\n",
    "########################################################################\n",
    "\n",
    "port.alpha = 0.05\n",
    "rm = 'MV' # Risk measure used, this time will be variance\n",
    "obj = 'Sharpe' # Objective function, could be MinRisk, MaxRet, Utility or Sharpe\n",
    "hist = False # False: BL covariance and risk factors scenarios\n",
    "             # True: historical covariance and scenarios\n",
    "             # 2: risk factors covariance and scenarios\n",
    "rf = 0 # Risk free rate\n",
    "l = 0 # Risk aversion factor, only useful when obj is 'Utility'\n",
    "\n",
    "w_fm = port.optimization(model='FM', rm=rm, obj=obj, rf=rf, l=l, hist=hist) \n",
    "\n",
    "# Estimate Portfolio weights using Black Litterman Bayesian Model:\n",
    "port.blfactors_stats(flavor='BLB',\n",
    "                     B=loadings,\n",
    "                     P_f=P_f,\n",
    "                     Q_f=Q_f/252,\n",
    "                     rf=0,\n",
    "                     delta=None,\n",
    "                     eq=True,\n",
    "                     const=True,\n",
    "                     diag=False,\n",
    "                     method_mu=method_mu,\n",
    "                     method_cov=method_cov)\n",
    "\n",
    "w_blb = port.optimization(model='BL_FM', rm=rm, obj=obj, rf=rf, l=l, hist=hist)\n",
    "\n",
    "# Estimate Portfolio weights using Augmented Black Litterman Model:\n",
    "port.blfactors_stats(flavor='ABL',\n",
    "                     B=loadings,\n",
    "                     P_f=P_f,\n",
    "                     Q_f=Q_f/252,\n",
    "                     rf=0,\n",
    "                     delta=None,\n",
    "                     eq=True,\n",
    "                     const=True,\n",
    "                     diag=False,\n",
    "                     method_mu=method_mu,\n",
    "                     method_cov=method_cov)\n",
    "\n",
    "w_abl = port.optimization(model='BL_FM', rm=rm, obj=obj, rf=rf, l=l, hist=hist)\n",
    "\n",
    "ws = pd.concat([w_fm, w_blb, w_abl], axis=1)\n",
    "ws.columns = ['Pure Factors', 'Bayesian BL', 'Augmented BL']\n",
    "\n",
    "display(ws.style.format(\"{:.4%}\").background_gradient(cmap='YlGn'))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can see that the we got a messsage that the covariance matrix is not a positive definite matrix, this is common when we work with views on assets or risk factors. In this case, Riskfolio-Lib replace the negative eigenvalues of covariance matrix with zeros and reconstruct the covariance matrix. The problem with this approach is common that the weights that we will get are highly concetrated in few assets.\n",
    "\n",
    "Other approach is using the mean vector estimated with Black Litterman with Factors and the covariance matrix that we get from historical returns or a factor model."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 3.4 Building Portfolios with mean vector from Black Litterman with Factors."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "You must convert self.cov_bl_fm to a positive definite matrix\n",
      "You must convert self.cov_bl_fm to a positive definite matrix\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<style  type=\"text/css\" >\n",
       "#T_34ba2_row0_col0,#T_34ba2_row0_col1,#T_34ba2_row0_col2,#T_34ba2_row1_col1,#T_34ba2_row2_col1,#T_34ba2_row5_col0,#T_34ba2_row5_col1,#T_34ba2_row5_col2,#T_34ba2_row7_col0,#T_34ba2_row8_col0,#T_34ba2_row8_col1,#T_34ba2_row9_col0,#T_34ba2_row9_col1,#T_34ba2_row10_col0,#T_34ba2_row10_col1,#T_34ba2_row11_col1,#T_34ba2_row12_col1,#T_34ba2_row13_col0,#T_34ba2_row13_col1{\n",
       "            background-color:  #ffffe5;\n",
       "            color:  #000000;\n",
       "        }#T_34ba2_row1_col0{\n",
       "            background-color:  #9fd788;\n",
       "            color:  #000000;\n",
       "        }#T_34ba2_row1_col2{\n",
       "            background-color:  #b8e293;\n",
       "            color:  #000000;\n",
       "        }#T_34ba2_row2_col0{\n",
       "            background-color:  #84cb7e;\n",
       "            color:  #000000;\n",
       "        }#T_34ba2_row2_col2{\n",
       "            background-color:  #fafdc9;\n",
       "            color:  #000000;\n",
       "        }#T_34ba2_row3_col0{\n",
       "            background-color:  #40aa5c;\n",
       "            color:  #000000;\n",
       "        }#T_34ba2_row3_col1{\n",
       "            background-color:  #f0f9b4;\n",
       "            color:  #000000;\n",
       "        }#T_34ba2_row3_col2,#T_34ba2_row4_col0,#T_34ba2_row7_col1{\n",
       "            background-color:  #004529;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_34ba2_row4_col1{\n",
       "            background-color:  #e8f6ae;\n",
       "            color:  #000000;\n",
       "        }#T_34ba2_row4_col2{\n",
       "            background-color:  #5ab76a;\n",
       "            color:  #000000;\n",
       "        }#T_34ba2_row6_col0{\n",
       "            background-color:  #c5e89a;\n",
       "            color:  #000000;\n",
       "        }#T_34ba2_row6_col1{\n",
       "            background-color:  #fafdcc;\n",
       "            color:  #000000;\n",
       "        }#T_34ba2_row6_col2{\n",
       "            background-color:  #00492b;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_34ba2_row7_col2{\n",
       "            background-color:  #f8fcbe;\n",
       "            color:  #000000;\n",
       "        }#T_34ba2_row8_col2,#T_34ba2_row11_col0{\n",
       "            background-color:  #c8e99b;\n",
       "            color:  #000000;\n",
       "        }#T_34ba2_row9_col2{\n",
       "            background-color:  #f9fdc4;\n",
       "            color:  #000000;\n",
       "        }#T_34ba2_row10_col2{\n",
       "            background-color:  #e7f6ad;\n",
       "            color:  #000000;\n",
       "        }#T_34ba2_row11_col2{\n",
       "            background-color:  #8dcf81;\n",
       "            color:  #000000;\n",
       "        }#T_34ba2_row12_col0{\n",
       "            background-color:  #2a8d49;\n",
       "            color:  #000000;\n",
       "        }#T_34ba2_row12_col2{\n",
       "            background-color:  #a7db8c;\n",
       "            color:  #000000;\n",
       "        }#T_34ba2_row13_col2{\n",
       "            background-color:  #e9f6af;\n",
       "            color:  #000000;\n",
       "        }</style><table id=\"T_34ba2_\" ><thead>    <tr>        <th class=\"blank level0\" ></th>        <th class=\"col_heading level0 col0\" >Pure Factors</th>        <th class=\"col_heading level0 col1\" >Bayesian BL</th>        <th class=\"col_heading level0 col2\" >Augmented BL</th>    </tr></thead><tbody>\n",
       "                <tr>\n",
       "                        <th id=\"T_34ba2_level0_row0\" class=\"row_heading level0 row0\" >APA</th>\n",
       "                        <td id=\"T_34ba2_row0_col0\" class=\"data row0 col0\" >0.0000%</td>\n",
       "                        <td id=\"T_34ba2_row0_col1\" class=\"data row0 col1\" >0.0000%</td>\n",
       "                        <td id=\"T_34ba2_row0_col2\" class=\"data row0 col2\" >0.0000%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_34ba2_level0_row1\" class=\"row_heading level0 row1\" >CMCSA</th>\n",
       "                        <td id=\"T_34ba2_row1_col0\" class=\"data row1 col0\" >10.6667%</td>\n",
       "                        <td id=\"T_34ba2_row1_col1\" class=\"data row1 col1\" >0.0000%</td>\n",
       "                        <td id=\"T_34ba2_row1_col2\" class=\"data row1 col2\" >7.3146%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_34ba2_level0_row2\" class=\"row_heading level0 row2\" >CNP</th>\n",
       "                        <td id=\"T_34ba2_row2_col0\" class=\"data row2 col0\" >12.2571%</td>\n",
       "                        <td id=\"T_34ba2_row2_col1\" class=\"data row2 col1\" >0.0000%</td>\n",
       "                        <td id=\"T_34ba2_row2_col2\" class=\"data row2 col2\" >1.6698%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_34ba2_level0_row3\" class=\"row_heading level0 row3\" >HPQ</th>\n",
       "                        <td id=\"T_34ba2_row3_col0\" class=\"data row3 col0\" >16.3689%</td>\n",
       "                        <td id=\"T_34ba2_row3_col1\" class=\"data row3 col1\" >10.8421%</td>\n",
       "                        <td id=\"T_34ba2_row3_col2\" class=\"data row3 col2\" >21.2752%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_34ba2_level0_row4\" class=\"row_heading level0 row4\" >PSA</th>\n",
       "                        <td id=\"T_34ba2_row4_col0\" class=\"data row4 col0\" >26.0443%</td>\n",
       "                        <td id=\"T_34ba2_row4_col1\" class=\"data row4 col1\" >13.2860%</td>\n",
       "                        <td id=\"T_34ba2_row4_col2\" class=\"data row4 col2\" >12.0815%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_34ba2_level0_row5\" class=\"row_heading level0 row5\" >SEE</th>\n",
       "                        <td id=\"T_34ba2_row5_col0\" class=\"data row5 col0\" >0.0767%</td>\n",
       "                        <td id=\"T_34ba2_row5_col1\" class=\"data row5 col1\" >0.0000%</td>\n",
       "                        <td id=\"T_34ba2_row5_col2\" class=\"data row5 col2\" >0.0000%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_34ba2_level0_row6\" class=\"row_heading level0 row6\" >ZION</th>\n",
       "                        <td id=\"T_34ba2_row6_col0\" class=\"data row6 col0\" >7.9948%</td>\n",
       "                        <td id=\"T_34ba2_row6_col1\" class=\"data row6 col1\" >5.0666%</td>\n",
       "                        <td id=\"T_34ba2_row6_col2\" class=\"data row6 col2\" >20.9109%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_34ba2_level0_row7\" class=\"row_heading level0 row7\" >PEP11900D031</th>\n",
       "                        <td id=\"T_34ba2_row7_col0\" class=\"data row7 col0\" >0.0000%</td>\n",
       "                        <td id=\"T_34ba2_row7_col1\" class=\"data row7 col1\" >70.8053%</td>\n",
       "                        <td id=\"T_34ba2_row7_col2\" class=\"data row7 col2\" >2.3390%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_34ba2_level0_row8\" class=\"row_heading level0 row8\" >PEP13000D012</th>\n",
       "                        <td id=\"T_34ba2_row8_col0\" class=\"data row8 col0\" >0.0000%</td>\n",
       "                        <td id=\"T_34ba2_row8_col1\" class=\"data row8 col1\" >0.0000%</td>\n",
       "                        <td id=\"T_34ba2_row8_col2\" class=\"data row8 col2\" >6.3644%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_34ba2_level0_row9\" class=\"row_heading level0 row9\" >PEP13000M088</th>\n",
       "                        <td id=\"T_34ba2_row9_col0\" class=\"data row9 col0\" >0.0000%</td>\n",
       "                        <td id=\"T_34ba2_row9_col1\" class=\"data row9 col1\" >0.0000%</td>\n",
       "                        <td id=\"T_34ba2_row9_col2\" class=\"data row9 col2\" >2.0302%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_34ba2_level0_row10\" class=\"row_heading level0 row10\" >PEP23900M103</th>\n",
       "                        <td id=\"T_34ba2_row10_col0\" class=\"data row10 col0\" >0.0000%</td>\n",
       "                        <td id=\"T_34ba2_row10_col1\" class=\"data row10 col1\" >0.0000%</td>\n",
       "                        <td id=\"T_34ba2_row10_col2\" class=\"data row10 col2\" >4.1450%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_34ba2_level0_row11\" class=\"row_heading level0 row11\" >PEP70101M530</th>\n",
       "                        <td id=\"T_34ba2_row11_col0\" class=\"data row11 col0\" >7.8240%</td>\n",
       "                        <td id=\"T_34ba2_row11_col1\" class=\"data row11 col1\" >0.0000%</td>\n",
       "                        <td id=\"T_34ba2_row11_col2\" class=\"data row11 col2\" >9.6183%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_34ba2_level0_row12\" class=\"row_heading level0 row12\" >PEP70101M571</th>\n",
       "                        <td id=\"T_34ba2_row12_col0\" class=\"data row12 col0\" >18.7674%</td>\n",
       "                        <td id=\"T_34ba2_row12_col1\" class=\"data row12 col1\" >0.0000%</td>\n",
       "                        <td id=\"T_34ba2_row12_col2\" class=\"data row12 col2\" >8.2717%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_34ba2_level0_row13\" class=\"row_heading level0 row13\" >PEP70310M156</th>\n",
       "                        <td id=\"T_34ba2_row13_col0\" class=\"data row13 col0\" >0.0000%</td>\n",
       "                        <td id=\"T_34ba2_row13_col1\" class=\"data row13 col1\" >0.0000%</td>\n",
       "                        <td id=\"T_34ba2_row13_col2\" class=\"data row13 col2\" >3.9793%</td>\n",
       "            </tr>\n",
       "    </tbody></table>"
      ],
      "text/plain": [
       "<pandas.io.formats.style.Styler at 0x7f8d0e9d3940>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "########################################################################\n",
    "# Calculating optimum portfolios\n",
    "########################################################################\n",
    "\n",
    "hist = 2 # False: BL covariance and risk factors scenarios\n",
    "         # True: historical covariance and scenarios\n",
    "         # 2: risk factors covariance and scenarios (Only in BL_FM)\n",
    "\n",
    "# Estimate Portfolio weights using Black Litterman Bayesian Model:\n",
    "port.blfactors_stats(flavor='BLB',\n",
    "                     B=loadings,\n",
    "                     P_f=P_f,\n",
    "                     Q_f=Q_f/252,\n",
    "                     rf=0,\n",
    "                     delta=None,\n",
    "                     eq=True,\n",
    "                     const=True,\n",
    "                     diag=False,\n",
    "                     method_mu=method_mu,\n",
    "                     method_cov=method_cov)\n",
    "\n",
    "w_blb = port.optimization(model='BL_FM', rm=rm, obj=obj, rf=rf, l=l, hist=hist)\n",
    "\n",
    "# Estimate Portfolio weights using Augmented Black Litterman Model:\n",
    "port.blfactors_stats(flavor='ABL',\n",
    "                     B=loadings,\n",
    "                     P_f=P_f,\n",
    "                     Q_f=Q_f/252,\n",
    "                     rf=0,\n",
    "                     delta=None,\n",
    "                     eq=True,\n",
    "                     const=True,\n",
    "                     diag=False,\n",
    "                     method_mu=method_mu,\n",
    "                     method_cov=method_cov)\n",
    "\n",
    "w_abl = port.optimization(model='BL_FM', rm=rm, obj=obj, rf=rf, l=l, hist=hist)\n",
    "\n",
    "ws = pd.concat([w_fm, w_blb, w_abl], axis=1)\n",
    "ws.columns = ['Pure Factors', 'Bayesian BL', 'Augmented BL']\n",
    "\n",
    "display(ws.style.format(\"{:.4%}\").background_gradient(cmap='YlGn'))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can see that when we only use the mean vector of Black Litterman with Factors, the weights that we get are more diversified. Also, we can see that the Augmented Black Litterman creates more diversified portfolios than the Bayesian Black Litterman."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 4. Estimating Black Litterman with Factors Mean Risk Portfolios\n",
    "\n",
    "When we use risk measures different than Standard Deviation, Riskfolio-Lib only considers the vector of expected returns, and use historical returns to calculate risk measures.\n",
    "\n",
    "### 4.1 Calculate Black Litterman Bayesian Portfolios for Several Risk Measures"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "You must convert self.cov_bl_fm to a positive definite matrix\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/danycajas/opt/anaconda3/lib/python3.8/site-packages/cvxpy/problems/problem.py:1060: UserWarning: Solution may be inaccurate. Try another solver, adjusting the solver settings, or solve with verbose=True for more information.\n",
      "  warnings.warn(\n"
     ]
    }
   ],
   "source": [
    "# Risk Measures available:\n",
    "#\n",
    "# 'MV': Standard Deviation.\n",
    "# 'MAD': Mean Absolute Deviation.\n",
    "# 'MSV': Semi Standard Deviation.\n",
    "# 'FLPM': First Lower Partial Moment (Omega Ratio).\n",
    "# 'SLPM': Second Lower Partial Moment (Sortino Ratio).\n",
    "# 'CVaR': Conditional Value at Risk.\n",
    "# 'EVaR': Entropic Value at Risk.\n",
    "# 'WR': Worst Realization (Minimax)\n",
    "# 'MDD': Maximum Drawdown of uncompounded cumulative returns (Calmar Ratio).\n",
    "# 'ADD': Average Drawdown of uncompounded cumulative returns.\n",
    "# 'CDaR': Conditional Drawdown at Risk of uncompounded cumulative returns.\n",
    "# 'EDaR': Entropic Drawdown at Risk of uncompounded cumulative returns.\n",
    "# 'UCI': Ulcer Index of uncompounded cumulative returns.\n",
    "\n",
    "rms = ['MV', 'MAD', 'MSV', 'FLPM', 'SLPM', 'CVaR',\n",
    "       'EVaR', 'WR', 'MDD', 'ADD', 'CDaR', 'UCI', 'EDaR']\n",
    "\n",
    "w_s = pd.DataFrame([])\n",
    "port.alpha = 0.05\n",
    "\n",
    "port.blfactors_stats(flavor='BLB',\n",
    "                     B=loadings,\n",
    "                     P_f=P_f,\n",
    "                     Q_f=Q_f/252,\n",
    "                     rf=0,\n",
    "                     delta=None,\n",
    "                     eq=True,\n",
    "                     const=True,\n",
    "                     diag=False,\n",
    "                     method_mu=method_mu,\n",
    "                     method_cov=method_cov)\n",
    "\n",
    "model = 'BL_FM'\n",
    "obj = 'Sharpe'\n",
    "\n",
    "for i in rms:\n",
    "    if i == 'MV':\n",
    "        hist = 2\n",
    "    else:\n",
    "        hist = True\n",
    "    w = port.optimization(model=model, rm=i, obj=obj, rf=rf, l=l, hist=hist)\n",
    "    w_s = pd.concat([w_s, w], axis=1)\n",
    "    \n",
    "w_s.columns = rms"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<style  type=\"text/css\" >\n",
       "#T_d1a4c_row0_col0,#T_d1a4c_row0_col1,#T_d1a4c_row0_col2,#T_d1a4c_row0_col3,#T_d1a4c_row0_col4,#T_d1a4c_row0_col5,#T_d1a4c_row0_col6,#T_d1a4c_row0_col7,#T_d1a4c_row0_col8,#T_d1a4c_row0_col9,#T_d1a4c_row0_col10,#T_d1a4c_row0_col11,#T_d1a4c_row0_col12,#T_d1a4c_row1_col0,#T_d1a4c_row1_col1,#T_d1a4c_row1_col2,#T_d1a4c_row1_col3,#T_d1a4c_row1_col4,#T_d1a4c_row1_col5,#T_d1a4c_row1_col6,#T_d1a4c_row1_col7,#T_d1a4c_row1_col8,#T_d1a4c_row1_col12,#T_d1a4c_row2_col0,#T_d1a4c_row2_col1,#T_d1a4c_row2_col2,#T_d1a4c_row2_col3,#T_d1a4c_row2_col4,#T_d1a4c_row2_col5,#T_d1a4c_row2_col6,#T_d1a4c_row2_col7,#T_d1a4c_row2_col8,#T_d1a4c_row2_col9,#T_d1a4c_row2_col10,#T_d1a4c_row2_col12,#T_d1a4c_row5_col0,#T_d1a4c_row5_col1,#T_d1a4c_row5_col2,#T_d1a4c_row5_col3,#T_d1a4c_row5_col4,#T_d1a4c_row5_col5,#T_d1a4c_row5_col6,#T_d1a4c_row5_col7,#T_d1a4c_row5_col10,#T_d1a4c_row5_col12,#T_d1a4c_row6_col7,#T_d1a4c_row8_col0,#T_d1a4c_row8_col1,#T_d1a4c_row8_col2,#T_d1a4c_row8_col3,#T_d1a4c_row8_col4,#T_d1a4c_row8_col5,#T_d1a4c_row8_col6,#T_d1a4c_row8_col7,#T_d1a4c_row8_col8,#T_d1a4c_row8_col9,#T_d1a4c_row8_col10,#T_d1a4c_row8_col11,#T_d1a4c_row8_col12,#T_d1a4c_row9_col0,#T_d1a4c_row9_col1,#T_d1a4c_row9_col2,#T_d1a4c_row9_col3,#T_d1a4c_row9_col4,#T_d1a4c_row9_col5,#T_d1a4c_row9_col6,#T_d1a4c_row9_col7,#T_d1a4c_row9_col8,#T_d1a4c_row9_col9,#T_d1a4c_row9_col10,#T_d1a4c_row9_col11,#T_d1a4c_row9_col12,#T_d1a4c_row10_col0,#T_d1a4c_row10_col1,#T_d1a4c_row10_col2,#T_d1a4c_row10_col3,#T_d1a4c_row10_col4,#T_d1a4c_row10_col5,#T_d1a4c_row10_col6,#T_d1a4c_row10_col7,#T_d1a4c_row10_col8,#T_d1a4c_row10_col9,#T_d1a4c_row10_col10,#T_d1a4c_row10_col11,#T_d1a4c_row10_col12,#T_d1a4c_row11_col0,#T_d1a4c_row11_col1,#T_d1a4c_row11_col2,#T_d1a4c_row11_col3,#T_d1a4c_row11_col4,#T_d1a4c_row11_col5,#T_d1a4c_row11_col6,#T_d1a4c_row11_col7,#T_d1a4c_row11_col8,#T_d1a4c_row11_col9,#T_d1a4c_row11_col10,#T_d1a4c_row11_col11,#T_d1a4c_row11_col12,#T_d1a4c_row12_col0,#T_d1a4c_row12_col1,#T_d1a4c_row12_col2,#T_d1a4c_row12_col3,#T_d1a4c_row12_col4,#T_d1a4c_row12_col5,#T_d1a4c_row12_col6,#T_d1a4c_row12_col7,#T_d1a4c_row12_col8,#T_d1a4c_row12_col9,#T_d1a4c_row12_col10,#T_d1a4c_row12_col11,#T_d1a4c_row12_col12,#T_d1a4c_row13_col0,#T_d1a4c_row13_col1,#T_d1a4c_row13_col2,#T_d1a4c_row13_col3,#T_d1a4c_row13_col4,#T_d1a4c_row13_col5,#T_d1a4c_row13_col6,#T_d1a4c_row13_col7,#T_d1a4c_row13_col8,#T_d1a4c_row13_col9,#T_d1a4c_row13_col10,#T_d1a4c_row13_col11,#T_d1a4c_row13_col12{\n",
       "            background-color:  #ffffe5;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row1_col9{\n",
       "            background-color:  #fafdc9;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row1_col10,#T_d1a4c_row3_col10{\n",
       "            background-color:  #feffe2;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row1_col11{\n",
       "            background-color:  #fbfdce;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row2_col11{\n",
       "            background-color:  #ffffe4;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row3_col0{\n",
       "            background-color:  #f0f9b4;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row3_col1,#T_d1a4c_row6_col3{\n",
       "            background-color:  #fdfed9;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row3_col2,#T_d1a4c_row6_col5{\n",
       "            background-color:  #d9f0a3;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row3_col3,#T_d1a4c_row6_col1{\n",
       "            background-color:  #fdfeda;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row3_col4{\n",
       "            background-color:  #d7efa2;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row3_col5{\n",
       "            background-color:  #bee596;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row3_col6,#T_d1a4c_row4_col2{\n",
       "            background-color:  #bde496;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row3_col7{\n",
       "            background-color:  #c3e698;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row3_col8{\n",
       "            background-color:  #e1f3a9;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row3_col9{\n",
       "            background-color:  #fdfedd;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row3_col11{\n",
       "            background-color:  #feffdf;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row3_col12,#T_d1a4c_row6_col0{\n",
       "            background-color:  #fafdcc;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row4_col0,#T_d1a4c_row6_col9{\n",
       "            background-color:  #e8f6ae;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row4_col1{\n",
       "            background-color:  #fcfed4;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row4_col3{\n",
       "            background-color:  #fbfed2;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row4_col4{\n",
       "            background-color:  #bce395;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row4_col5{\n",
       "            background-color:  #8ed082;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row4_col6{\n",
       "            background-color:  #75c578;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row4_col7{\n",
       "            background-color:  #6fc174;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row4_col8{\n",
       "            background-color:  #00522e;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_d1a4c_row4_col9{\n",
       "            background-color:  #58b669;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row4_col10{\n",
       "            background-color:  #31974f;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row4_col11{\n",
       "            background-color:  #40aa5c;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row4_col12{\n",
       "            background-color:  #15793e;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_d1a4c_row5_col8{\n",
       "            background-color:  #f9fdc5;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row5_col9{\n",
       "            background-color:  #f7fcbc;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row5_col11{\n",
       "            background-color:  #f8fcbd;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row6_col2{\n",
       "            background-color:  #f7fcb9;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row6_col4{\n",
       "            background-color:  #f6fcb8;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row6_col6{\n",
       "            background-color:  #f4fbb7;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row6_col8{\n",
       "            background-color:  #fafdc8;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row6_col10{\n",
       "            background-color:  #ebf7b0;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row6_col11{\n",
       "            background-color:  #e7f6ad;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row6_col12{\n",
       "            background-color:  #f1fab5;\n",
       "            color:  #000000;\n",
       "        }#T_d1a4c_row7_col0,#T_d1a4c_row7_col1,#T_d1a4c_row7_col2,#T_d1a4c_row7_col3,#T_d1a4c_row7_col4,#T_d1a4c_row7_col5,#T_d1a4c_row7_col6,#T_d1a4c_row7_col7,#T_d1a4c_row7_col8,#T_d1a4c_row7_col9,#T_d1a4c_row7_col10,#T_d1a4c_row7_col11,#T_d1a4c_row7_col12{\n",
       "            background-color:  #004529;\n",
       "            color:  #f1f1f1;\n",
       "        }</style><table id=\"T_d1a4c_\" ><thead>    <tr>        <th class=\"blank level0\" ></th>        <th class=\"col_heading level0 col0\" >MV</th>        <th class=\"col_heading level0 col1\" >MAD</th>        <th class=\"col_heading level0 col2\" >MSV</th>        <th class=\"col_heading level0 col3\" >FLPM</th>        <th class=\"col_heading level0 col4\" >SLPM</th>        <th class=\"col_heading level0 col5\" >CVaR</th>        <th class=\"col_heading level0 col6\" >EVaR</th>        <th class=\"col_heading level0 col7\" >WR</th>        <th class=\"col_heading level0 col8\" >MDD</th>        <th class=\"col_heading level0 col9\" >ADD</th>        <th class=\"col_heading level0 col10\" >CDaR</th>        <th class=\"col_heading level0 col11\" >UCI</th>        <th class=\"col_heading level0 col12\" >EDaR</th>    </tr></thead><tbody>\n",
       "                <tr>\n",
       "                        <th id=\"T_d1a4c_level0_row0\" class=\"row_heading level0 row0\" >APA</th>\n",
       "                        <td id=\"T_d1a4c_row0_col0\" class=\"data row0 col0\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row0_col1\" class=\"data row0 col1\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row0_col2\" class=\"data row0 col2\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row0_col3\" class=\"data row0 col3\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row0_col4\" class=\"data row0 col4\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row0_col5\" class=\"data row0 col5\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row0_col6\" class=\"data row0 col6\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row0_col7\" class=\"data row0 col7\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row0_col8\" class=\"data row0 col8\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row0_col9\" class=\"data row0 col9\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row0_col10\" class=\"data row0 col10\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row0_col11\" class=\"data row0 col11\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row0_col12\" class=\"data row0 col12\" >0.00%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_d1a4c_level0_row1\" class=\"row_heading level0 row1\" >CMCSA</th>\n",
       "                        <td id=\"T_d1a4c_row1_col0\" class=\"data row1 col0\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row1_col1\" class=\"data row1 col1\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row1_col2\" class=\"data row1 col2\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row1_col3\" class=\"data row1 col3\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row1_col4\" class=\"data row1 col4\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row1_col5\" class=\"data row1 col5\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row1_col6\" class=\"data row1 col6\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row1_col7\" class=\"data row1 col7\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row1_col8\" class=\"data row1 col8\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row1_col9\" class=\"data row1 col9\" >4.07%</td>\n",
       "                        <td id=\"T_d1a4c_row1_col10\" class=\"data row1 col10\" >0.45%</td>\n",
       "                        <td id=\"T_d1a4c_row1_col11\" class=\"data row1 col11\" >3.37%</td>\n",
       "                        <td id=\"T_d1a4c_row1_col12\" class=\"data row1 col12\" >0.00%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_d1a4c_level0_row2\" class=\"row_heading level0 row2\" >CNP</th>\n",
       "                        <td id=\"T_d1a4c_row2_col0\" class=\"data row2 col0\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row2_col1\" class=\"data row2 col1\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row2_col2\" class=\"data row2 col2\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row2_col3\" class=\"data row2 col3\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row2_col4\" class=\"data row2 col4\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row2_col5\" class=\"data row2 col5\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row2_col6\" class=\"data row2 col6\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row2_col7\" class=\"data row2 col7\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row2_col8\" class=\"data row2 col8\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row2_col9\" class=\"data row2 col9\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row2_col10\" class=\"data row2 col10\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row2_col11\" class=\"data row2 col11\" >0.31%</td>\n",
       "                        <td id=\"T_d1a4c_row2_col12\" class=\"data row2 col12\" >0.00%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_d1a4c_level0_row3\" class=\"row_heading level0 row3\" >HPQ</th>\n",
       "                        <td id=\"T_d1a4c_row3_col0\" class=\"data row3 col0\" >10.84%</td>\n",
       "                        <td id=\"T_d1a4c_row3_col1\" class=\"data row3 col1\" >3.17%</td>\n",
       "                        <td id=\"T_d1a4c_row3_col2\" class=\"data row3 col2\" >14.69%</td>\n",
       "                        <td id=\"T_d1a4c_row3_col3\" class=\"data row3 col3\" >2.95%</td>\n",
       "                        <td id=\"T_d1a4c_row3_col4\" class=\"data row3 col4\" >14.79%</td>\n",
       "                        <td id=\"T_d1a4c_row3_col5\" class=\"data row3 col5\" >16.12%</td>\n",
       "                        <td id=\"T_d1a4c_row3_col6\" class=\"data row3 col6\" >16.77%</td>\n",
       "                        <td id=\"T_d1a4c_row3_col7\" class=\"data row3 col7\" >17.21%</td>\n",
       "                        <td id=\"T_d1a4c_row3_col8\" class=\"data row3 col8\" >9.18%</td>\n",
       "                        <td id=\"T_d1a4c_row3_col9\" class=\"data row3 col9\" >1.24%</td>\n",
       "                        <td id=\"T_d1a4c_row3_col10\" class=\"data row3 col10\" >0.43%</td>\n",
       "                        <td id=\"T_d1a4c_row3_col11\" class=\"data row3 col11\" >0.84%</td>\n",
       "                        <td id=\"T_d1a4c_row3_col12\" class=\"data row3 col12\" >3.58%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_d1a4c_level0_row4\" class=\"row_heading level0 row4\" >PSA</th>\n",
       "                        <td id=\"T_d1a4c_row4_col0\" class=\"data row4 col0\" >13.29%</td>\n",
       "                        <td id=\"T_d1a4c_row4_col1\" class=\"data row4 col1\" >4.53%</td>\n",
       "                        <td id=\"T_d1a4c_row4_col2\" class=\"data row4 col2\" >19.30%</td>\n",
       "                        <td id=\"T_d1a4c_row4_col3\" class=\"data row4 col3\" >4.92%</td>\n",
       "                        <td id=\"T_d1a4c_row4_col4\" class=\"data row4 col4\" >19.49%</td>\n",
       "                        <td id=\"T_d1a4c_row4_col5\" class=\"data row4 col5\" >22.07%</td>\n",
       "                        <td id=\"T_d1a4c_row4_col6\" class=\"data row4 col6\" >25.69%</td>\n",
       "                        <td id=\"T_d1a4c_row4_col7\" class=\"data row4 col7\" >28.31%</td>\n",
       "                        <td id=\"T_d1a4c_row4_col8\" class=\"data row4 col8\" >40.57%</td>\n",
       "                        <td id=\"T_d1a4c_row4_col9\" class=\"data row4 col9\" >28.83%</td>\n",
       "                        <td id=\"T_d1a4c_row4_col10\" class=\"data row4 col10\" >36.63%</td>\n",
       "                        <td id=\"T_d1a4c_row4_col11\" class=\"data row4 col11\" >30.88%</td>\n",
       "                        <td id=\"T_d1a4c_row4_col12\" class=\"data row4 col12\" >39.43%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_d1a4c_level0_row5\" class=\"row_heading level0 row5\" >SEE</th>\n",
       "                        <td id=\"T_d1a4c_row5_col0\" class=\"data row5 col0\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row5_col1\" class=\"data row5 col1\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row5_col2\" class=\"data row5 col2\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row5_col3\" class=\"data row5 col3\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row5_col4\" class=\"data row5 col4\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row5_col5\" class=\"data row5 col5\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row5_col6\" class=\"data row5 col6\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row5_col7\" class=\"data row5 col7\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row5_col8\" class=\"data row5 col8\" >3.97%</td>\n",
       "                        <td id=\"T_d1a4c_row5_col9\" class=\"data row5 col9\" >5.97%</td>\n",
       "                        <td id=\"T_d1a4c_row5_col10\" class=\"data row5 col10\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row5_col11\" class=\"data row5 col11\" >5.75%</td>\n",
       "                        <td id=\"T_d1a4c_row5_col12\" class=\"data row5 col12\" >0.11%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_d1a4c_level0_row6\" class=\"row_heading level0 row6\" >ZION</th>\n",
       "                        <td id=\"T_d1a4c_row6_col0\" class=\"data row6 col0\" >5.07%</td>\n",
       "                        <td id=\"T_d1a4c_row6_col1\" class=\"data row6 col1\" >2.95%</td>\n",
       "                        <td id=\"T_d1a4c_row6_col2\" class=\"data row6 col2\" >7.52%</td>\n",
       "                        <td id=\"T_d1a4c_row6_col3\" class=\"data row6 col3\" >3.22%</td>\n",
       "                        <td id=\"T_d1a4c_row6_col4\" class=\"data row6 col4\" >7.57%</td>\n",
       "                        <td id=\"T_d1a4c_row6_col5\" class=\"data row6 col5\" >12.43%</td>\n",
       "                        <td id=\"T_d1a4c_row6_col6\" class=\"data row6 col6\" >6.94%</td>\n",
       "                        <td id=\"T_d1a4c_row6_col7\" class=\"data row6 col7\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row6_col8\" class=\"data row6 col8\" >3.62%</td>\n",
       "                        <td id=\"T_d1a4c_row6_col9\" class=\"data row6 col9\" >9.54%</td>\n",
       "                        <td id=\"T_d1a4c_row6_col10\" class=\"data row6 col10\" >9.38%</td>\n",
       "                        <td id=\"T_d1a4c_row6_col11\" class=\"data row6 col11\" >9.58%</td>\n",
       "                        <td id=\"T_d1a4c_row6_col12\" class=\"data row6 col12\" >7.50%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_d1a4c_level0_row7\" class=\"row_heading level0 row7\" >PEP11900D031</th>\n",
       "                        <td id=\"T_d1a4c_row7_col0\" class=\"data row7 col0\" >70.81%</td>\n",
       "                        <td id=\"T_d1a4c_row7_col1\" class=\"data row7 col1\" >89.35%</td>\n",
       "                        <td id=\"T_d1a4c_row7_col2\" class=\"data row7 col2\" >58.50%</td>\n",
       "                        <td id=\"T_d1a4c_row7_col3\" class=\"data row7 col3\" >88.91%</td>\n",
       "                        <td id=\"T_d1a4c_row7_col4\" class=\"data row7 col4\" >58.14%</td>\n",
       "                        <td id=\"T_d1a4c_row7_col5\" class=\"data row7 col5\" >49.39%</td>\n",
       "                        <td id=\"T_d1a4c_row7_col6\" class=\"data row7 col6\" >50.60%</td>\n",
       "                        <td id=\"T_d1a4c_row7_col7\" class=\"data row7 col7\" >54.47%</td>\n",
       "                        <td id=\"T_d1a4c_row7_col8\" class=\"data row7 col8\" >42.68%</td>\n",
       "                        <td id=\"T_d1a4c_row7_col9\" class=\"data row7 col9\" >50.36%</td>\n",
       "                        <td id=\"T_d1a4c_row7_col10\" class=\"data row7 col10\" >53.10%</td>\n",
       "                        <td id=\"T_d1a4c_row7_col11\" class=\"data row7 col11\" >49.28%</td>\n",
       "                        <td id=\"T_d1a4c_row7_col12\" class=\"data row7 col12\" >49.38%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_d1a4c_level0_row8\" class=\"row_heading level0 row8\" >PEP13000D012</th>\n",
       "                        <td id=\"T_d1a4c_row8_col0\" class=\"data row8 col0\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row8_col1\" class=\"data row8 col1\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row8_col2\" class=\"data row8 col2\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row8_col3\" class=\"data row8 col3\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row8_col4\" class=\"data row8 col4\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row8_col5\" class=\"data row8 col5\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row8_col6\" class=\"data row8 col6\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row8_col7\" class=\"data row8 col7\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row8_col8\" class=\"data row8 col8\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row8_col9\" class=\"data row8 col9\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row8_col10\" class=\"data row8 col10\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row8_col11\" class=\"data row8 col11\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row8_col12\" class=\"data row8 col12\" >0.00%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_d1a4c_level0_row9\" class=\"row_heading level0 row9\" >PEP13000M088</th>\n",
       "                        <td id=\"T_d1a4c_row9_col0\" class=\"data row9 col0\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row9_col1\" class=\"data row9 col1\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row9_col2\" class=\"data row9 col2\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row9_col3\" class=\"data row9 col3\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row9_col4\" class=\"data row9 col4\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row9_col5\" class=\"data row9 col5\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row9_col6\" class=\"data row9 col6\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row9_col7\" class=\"data row9 col7\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row9_col8\" class=\"data row9 col8\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row9_col9\" class=\"data row9 col9\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row9_col10\" class=\"data row9 col10\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row9_col11\" class=\"data row9 col11\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row9_col12\" class=\"data row9 col12\" >0.00%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_d1a4c_level0_row10\" class=\"row_heading level0 row10\" >PEP23900M103</th>\n",
       "                        <td id=\"T_d1a4c_row10_col0\" class=\"data row10 col0\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row10_col1\" class=\"data row10 col1\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row10_col2\" class=\"data row10 col2\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row10_col3\" class=\"data row10 col3\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row10_col4\" class=\"data row10 col4\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row10_col5\" class=\"data row10 col5\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row10_col6\" class=\"data row10 col6\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row10_col7\" class=\"data row10 col7\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row10_col8\" class=\"data row10 col8\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row10_col9\" class=\"data row10 col9\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row10_col10\" class=\"data row10 col10\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row10_col11\" class=\"data row10 col11\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row10_col12\" class=\"data row10 col12\" >0.00%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_d1a4c_level0_row11\" class=\"row_heading level0 row11\" >PEP70101M530</th>\n",
       "                        <td id=\"T_d1a4c_row11_col0\" class=\"data row11 col0\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row11_col1\" class=\"data row11 col1\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row11_col2\" class=\"data row11 col2\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row11_col3\" class=\"data row11 col3\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row11_col4\" class=\"data row11 col4\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row11_col5\" class=\"data row11 col5\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row11_col6\" class=\"data row11 col6\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row11_col7\" class=\"data row11 col7\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row11_col8\" class=\"data row11 col8\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row11_col9\" class=\"data row11 col9\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row11_col10\" class=\"data row11 col10\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row11_col11\" class=\"data row11 col11\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row11_col12\" class=\"data row11 col12\" >0.00%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_d1a4c_level0_row12\" class=\"row_heading level0 row12\" >PEP70101M571</th>\n",
       "                        <td id=\"T_d1a4c_row12_col0\" class=\"data row12 col0\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row12_col1\" class=\"data row12 col1\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row12_col2\" class=\"data row12 col2\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row12_col3\" class=\"data row12 col3\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row12_col4\" class=\"data row12 col4\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row12_col5\" class=\"data row12 col5\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row12_col6\" class=\"data row12 col6\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row12_col7\" class=\"data row12 col7\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row12_col8\" class=\"data row12 col8\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row12_col9\" class=\"data row12 col9\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row12_col10\" class=\"data row12 col10\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row12_col11\" class=\"data row12 col11\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row12_col12\" class=\"data row12 col12\" >0.00%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_d1a4c_level0_row13\" class=\"row_heading level0 row13\" >PEP70310M156</th>\n",
       "                        <td id=\"T_d1a4c_row13_col0\" class=\"data row13 col0\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row13_col1\" class=\"data row13 col1\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row13_col2\" class=\"data row13 col2\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row13_col3\" class=\"data row13 col3\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row13_col4\" class=\"data row13 col4\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row13_col5\" class=\"data row13 col5\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row13_col6\" class=\"data row13 col6\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row13_col7\" class=\"data row13 col7\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row13_col8\" class=\"data row13 col8\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row13_col9\" class=\"data row13 col9\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row13_col10\" class=\"data row13 col10\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row13_col11\" class=\"data row13 col11\" >0.00%</td>\n",
       "                        <td id=\"T_d1a4c_row13_col12\" class=\"data row13 col12\" >0.00%</td>\n",
       "            </tr>\n",
       "    </tbody></table>"
      ],
      "text/plain": [
       "<pandas.io.formats.style.Styler at 0x7f8d0a36bca0>"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "w_s.style.format(\"{:.2%}\").background_gradient(cmap='YlGn')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:>"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAzIAAAGpCAYAAABWCwOEAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMA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23ntvTj311FVeb5999umyWCMzu+ziKzNmzJhsvxe1JEmrZdJGtf++CMDcnYYCMHTe3LIikqQ3Ze7cuQwdOrTsMErRUe4RcXdmjunofBf7S5IkSaocCxlJkiRJleMaGUlS5Q2aeA0AC9YpORBJUrdxREaSJElS5VjISJIkSaocCxlJkiRJlWMhI0mSJKnF3//+d8aNG8eQIUPYeeedOeSQQ4gI5s+f3+a8z3/+83zve99b4XUGDRrE8OHDGTFiBO9617t49NFH6xqni/0lSZKkHuqHxx5a1+t9YerVK+3PTI488khOPPFEmpqaAJg1axaLFi2iqamJs846C4Bly5bx61//mj/96U8rvd60adPYbLPNOOuss/jGN77B+eefX59EcERGkiRJUs20adPo27cvp5xySkvbqFGj+PGPf9xS2ADccsstDBo0iO23354jjjiC3XbbjWHDhjF58uQOr7v33nvzxBNP1DVWR2QkSZIkATBnzhx222235dpHjBjBGmuswX333cfIkSNpampi/PjxAPziF79g0003ZdGiRey+++586EMfon///m2ef91113HEEUfUNVZHZCRJkiSt0vjx42lqamLJkiVceeWVfPjDHwbg3HPPZeTIkey11148/vjjPPjggy3POeCAA9h888254YYbOO644+oaj4WMJEmSJACGDRvG3Xff3WHf+PHjueSSS7jhhhsYMWIEm2++OdOnT+eGG27gtttu47777mP06NEsXry45TnTpk3j0UcfZdiwYZx55pl1jdVCRpIkSRIA7373u3n11VfbLMq/6667uPnmmxkyZAj9+/dn4sSJLdPKXnzxRTbZZBPWXXdd5s2bx+23377cNfv168c555zDxRdfzHPPPVe3WC1kJEmSJAEQEVx++eVcf/31DBkyhGHDhjFp0iS23nproBiVmTdvHkceeSQABx10EEuWLGHEiBF89atfZa+99urwultttRXjx4/nvPPOq1+smVm3i70ZY8aMyZkzZ5byvSVJjWXQxGsAWLBObf71pBcBmLvTUACGzptbSlyS9GbNnTuXoUOHlh1GKTrKPSLuzswxHZ3viIwkSZKkyrGQkSRJklQ5FjKSJEmSKsdCRpIkSVLlWMhIkiRJqhwLGUmSJEmVs2bZAUiSJEnqOfr06cPw4cNbjseNG8fixYt59dVX+fa3v93SPmvWLMaPH8/cuR1vcT9p0iTOP/98BgwYwGuvvcZXv/rVlhtp1oOFjCRJktRDLZx4a12vN/A7+6/ynH79+jFr1qw2bfPnz+fggw9uU8g0NTVx3HHHrfRap59+OhMmTODBBx9kt9124+ijj6Zv375vKfb2nFomSZIkaaXe8Y53sPHGG3PHHXe0tF1yySWMGzeO888/n913352RI0fyoQ99iFdeeWW55++www6su+66PP/883WLyUJGkiRJUotFixYxatSolq+pU6cCMH78eJqamgC4/fbb6d+/PzvssANHHXUUd911F/fddx9Dhw7lggsuWO6a99xzDzvssAObb7553eJ0apkkSZKkFh1NLYNircw+++zDD3/4Q5qamlrWu8yZM4f/+I//4IUXXuDll1/mwAMPbHnOj370I84//3weeeQRrrvuurrG6YiMJEmSpFXadtttGTRoEDfffDOXXXYZxxxzDAAnnXQSP/3pT5k9ezZnnXUWixcvbnnO6aefzvz585k6dSonnHBCm77VZSEjSZIkqVPGjx/P6aefzpAhQxg4cCAAL730EltttRWvv/46v/rVrzp83lFHHcWYMWO46KKL6haLhYwkSZKkFu3XyEycOLGl78Mf/jAPPPAA48aNa2n7+te/zp577sn73vc+dtpppxVe98wzz+Tss89m2bJldYnTNTKSJElSD9WZ7ZLrbenSpSvsGzBgAK+//nqbtk996lN86lOfWu7cSZMmtTnebbfdmD9/fl1iBEdkJEmSJFWQhYwkSZKkyrGQkSRJklQ5FjKSJEmSKsdCRpIkSVLlWMhIkiRJqpxOFTIRcVBEzI+IhyJi4grOGRsRsyLigYi4ub5hSpIkSepqp59+Ouecc07L8YEHHsgnPvGJluMvfOELnH322fTr149Ro0ax8847c8IJJyy3JXN3WOV9ZCKiD3Ae8D5gIXBXRFyVmX9udc7GwH8BB2XmYxGxeRfFK0mSJPUa7e/F0tXX22effbj00kv5/Oc/z7Jly3jmmWf45z//2dI/Y8YMzjnnHIYMGcKsWbNYunQp73vf+7jkkkv4yEc+UtdYV6UzIzJ7AA9l5iOZ+RrQBBze7pzjgN9k5mMAmfmP+oYpSZIkqavtu+++zJgxA4AHHniAXXbZhQ022IDnn3+eV199lblz57LJJpu0nN+nTx/22GMPnnjiiW6PtTOFzDbA462OF9baWtsR2CQipkfE3RFxQkcXioiTI2JmRMx8+umn31rEkiRJkrrE1ltvzZprrsljjz3GjBkz2Hvvvdlzzz257bbbmDlzJiNGjGCttdZqOX/x4sXccccdHHTQQd0ea2cKmeigLdsdrwnsBnwAOBD4akTsuNyTMidn5pjMHDNgwIA3HawkSZKkrtU8KtNcyOy9994tx/vssw8ADz/8MKNGjaJ///5st912jBgxotvj7EwhsxDYttXxQOBvHZxzXWb+KzOfAW4BRtYnREmSJEndZZ999mHGjBnMnj2bXXbZhb322ovbbruNGTNmsO+++wK0rJF56KGHuP3227nqqqu6Pc7OFDJ3ATtExOCIWAsYB7SP9Epg/4hYMyLWBfYE5tY3VEmSJEldbd999+Xqq69m0003pU+fPmy66aa88MIL3Hbbbey9995tzt1qq634zne+w7e//e1uj3OVhUxmLgE+A/yeoji5JDMfiIhTIuKU2jlzgeuA+4E7gf/JzDldF7YkSZKkrjB8+HCeeeYZ9tprrzZtG220EZttttly5x9xxBG88sor3Hrrrd0Z5qq3XwbIzGuBa9u1/bzd8feB79cvNEmSJKl3q/f2y53Rp0+fNlsuA1x44YUtjwcNGsScOW+MWUQE9913X3eF16JThYwkSVUy/KLhAFxSchySpK7TmTUykiRV2nmn3MR5p9xUdhiSpDqykJEkSZJUORYykiRJkirHQkaSJElS5VjISJIkSaocCxlJkiRJLSKC448/vuV4yZIlDBgwgEMPPRQotmIeMGAAo0ePZocdduDAAw9kxowZLeefdNJJDB48mJEjR7Ljjjtywgkn8MQTT9Q9TrdfliRJknqoG28aUtfrvefdD6/ynPXWW485c+awaNEi+vXrx/XXX88222zT5pxjjz2Wn/70pwBMmzaNo446imnTpjF06FAAvv/973P00UeTmZxzzjkccMABzJkzh7XWWqtuuTgiI0mSJKmNgw8+mGuuuQaAKVOmMH78+BWee8ABB3Dy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qs38qs38ymMhI0nqFSJidmYOrz1eE7gzM3ctOay6aOTcoFcUauZXYeZXHhf7S5J6i9ebH2TmkohG2EyoRSPnBrBzq0LtAuDOkuOpN/OrNvMriYWMJKm3GNluN6/m3b0CyMzcsLzQVlsj5waNX6iZX7WZX0mcWiZJknq0VrsmQdudkxqiUDM/8+vJenJ+FjKSJEmSKmeNsgOQJEmSpDfLQkaSJElS5VjISJIkSaocCxlJkiRJlWMhI0mSJKly/v9bhte0zNTivgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 1008x432 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "\n",
    "# Plotting a comparison of assets weights for each portfolio\n",
    "\n",
    "fig = plt.gcf()\n",
    "fig.set_figwidth(14)\n",
    "fig.set_figheight(6)\n",
    "ax = fig.subplots(nrows=1, ncols=1)\n",
    "\n",
    "w_s.plot.bar(ax=ax)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 4.2 Calculate Augmented Black Litterman Portfolios for Several Risk Measures"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "You must convert self.cov_bl_fm to a positive definite matrix\n"
     ]
    }
   ],
   "source": [
    "# Risk Measures available:\n",
    "#\n",
    "# 'MV': Standard Deviation.\n",
    "# 'MAD': Mean Absolute Deviation.\n",
    "# 'MSV': Semi Standard Deviation.\n",
    "# 'FLPM': First Lower Partial Moment (Omega Ratio).\n",
    "# 'SLPM': Second Lower Partial Moment (Sortino Ratio).\n",
    "# 'CVaR': Conditional Value at Risk.\n",
    "# 'EVaR': Entropic Value at Risk.\n",
    "# 'WR': Worst Realization (Minimax)\n",
    "# 'MDD': Maximum Drawdown of uncompounded cumulative returns (Calmar Ratio).\n",
    "# 'ADD': Average Drawdown of uncompounded cumulative returns.\n",
    "# 'CDaR': Conditional Drawdown at Risk of uncompounded cumulative returns.\n",
    "# 'EDaR': Entropic Drawdown at Risk of uncompounded cumulative returns.\n",
    "# 'UCI': Ulcer Index of uncompounded cumulative returns.\n",
    "\n",
    "rms = ['MV', 'MAD', 'MSV', 'FLPM', 'SLPM', 'CVaR',\n",
    "       'EVaR', 'WR', 'MDD', 'ADD', 'CDaR', 'UCI', 'EDaR']\n",
    "\n",
    "w_s = pd.DataFrame([])\n",
    "port.alpha = 0.05\n",
    "\n",
    "port.blfactors_stats(flavor='ABL',\n",
    "                     B=loadings,\n",
    "                     P_f=P_f,\n",
    "                     Q_f=Q_f/252,\n",
    "                     rf=0,\n",
    "                     delta=None,\n",
    "                     eq=True,\n",
    "                     const=True,\n",
    "                     diag=False,\n",
    "                     method_mu=method_mu,\n",
    "                     method_cov=method_cov)\n",
    "\n",
    "model = 'BL_FM'\n",
    "obj = 'Sharpe'\n",
    "\n",
    "for i in rms:\n",
    "    if i == 'MV':\n",
    "        hist = 2\n",
    "    else:\n",
    "        hist = True\n",
    "    w = port.optimization(model=model, rm=i, obj=obj, rf=rf, l=l, hist=hist)\n",
    "    w_s = pd.concat([w_s, w], axis=1)\n",
    "    \n",
    "w_s.columns = rms"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<style  type=\"text/css\" >\n",
       "#T_01a33_row0_col0,#T_01a33_row0_col1,#T_01a33_row0_col2,#T_01a33_row0_col3,#T_01a33_row0_col4,#T_01a33_row0_col5,#T_01a33_row0_col6,#T_01a33_row0_col7,#T_01a33_row0_col8,#T_01a33_row0_col9,#T_01a33_row0_col10,#T_01a33_row0_col11,#T_01a33_row0_col12,#T_01a33_row2_col2,#T_01a33_row2_col4,#T_01a33_row2_col5,#T_01a33_row2_col6,#T_01a33_row2_col7,#T_01a33_row4_col7,#T_01a33_row5_col0,#T_01a33_row5_col1,#T_01a33_row5_col2,#T_01a33_row5_col3,#T_01a33_row5_col4,#T_01a33_row5_col5,#T_01a33_row5_col6,#T_01a33_row5_col7,#T_01a33_row7_col2,#T_01a33_row7_col4,#T_01a33_row7_col5,#T_01a33_row7_col6,#T_01a33_row7_col7,#T_01a33_row7_col8,#T_01a33_row7_col9,#T_01a33_row7_col10,#T_01a33_row7_col11,#T_01a33_row7_col12,#T_01a33_row8_col8,#T_01a33_row8_col9,#T_01a33_row8_col10,#T_01a33_row8_col11,#T_01a33_row8_col12,#T_01a33_row9_col1,#T_01a33_row9_col2,#T_01a33_row9_col3,#T_01a33_row9_col4,#T_01a33_row9_col5,#T_01a33_row9_col6,#T_01a33_row9_col7,#T_01a33_row9_col9,#T_01a33_row9_col10,#T_01a33_row9_col11,#T_01a33_row9_col12,#T_01a33_row10_col1,#T_01a33_row10_col2,#T_01a33_row10_col3,#T_01a33_row10_col4,#T_01a33_row10_col5,#T_01a33_row10_col6,#T_01a33_row10_col7,#T_01a33_row10_col8,#T_01a33_row10_col10,#T_01a33_row10_col11,#T_01a33_row10_col12,#T_01a33_row11_col5,#T_01a33_row11_col6,#T_01a33_row11_col7,#T_01a33_row11_col8,#T_01a33_row11_col9,#T_01a33_row11_col10,#T_01a33_row11_col11,#T_01a33_row11_col12,#T_01a33_row12_col8,#T_01a33_row13_col1,#T_01a33_row13_col2,#T_01a33_row13_col3,#T_01a33_row13_col4,#T_01a33_row13_col5,#T_01a33_row13_col6,#T_01a33_row13_col7,#T_01a33_row13_col8,#T_01a33_row13_col9,#T_01a33_row13_col10,#T_01a33_row13_col11,#T_01a33_row13_col12{\n",
       "            background-color:  #ffffe5;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row1_col0{\n",
       "            background-color:  #b8e293;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row1_col1{\n",
       "            background-color:  #bee596;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row1_col2,#T_01a33_row1_col4{\n",
       "            background-color:  #89ce80;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row1_col3{\n",
       "            background-color:  #d7efa2;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row1_col5{\n",
       "            background-color:  #bde496;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row1_col6,#T_01a33_row6_col7{\n",
       "            background-color:  #c3e698;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row1_col7{\n",
       "            background-color:  #f7fcbc;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row1_col8,#T_01a33_row2_col1{\n",
       "            background-color:  #eff9b3;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row1_col9{\n",
       "            background-color:  #7fc97c;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row1_col10{\n",
       "            background-color:  #f7fcb9;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row1_col11{\n",
       "            background-color:  #b9e294;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row1_col12{\n",
       "            background-color:  #ecf7b1;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row2_col0{\n",
       "            background-color:  #fafdc9;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row2_col3,#T_01a33_row3_col9{\n",
       "            background-color:  #f8fcc0;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row2_col8{\n",
       "            background-color:  #81ca7d;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row2_col9{\n",
       "            background-color:  #f5fbb8;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row2_col10{\n",
       "            background-color:  #47ae60;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row2_col11{\n",
       "            background-color:  #cbea9c;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row2_col12{\n",
       "            background-color:  #7ac77a;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row3_col0,#T_01a33_row3_col1,#T_01a33_row3_col3,#T_01a33_row4_col8,#T_01a33_row4_col9,#T_01a33_row4_col10,#T_01a33_row4_col11,#T_01a33_row4_col12,#T_01a33_row8_col2,#T_01a33_row8_col4,#T_01a33_row8_col5,#T_01a33_row12_col6,#T_01a33_row12_col7{\n",
       "            background-color:  #004529;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_01a33_row3_col2{\n",
       "            background-color:  #00472a;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_01a33_row3_col4{\n",
       "            background-color:  #004d2c;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_01a33_row3_col5{\n",
       "            background-color:  #3aa257;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row3_col6,#T_01a33_row4_col0{\n",
       "            background-color:  #5ab76a;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row3_col7,#T_01a33_row5_col11,#T_01a33_row6_col10{\n",
       "            background-color:  #c1e698;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row3_col8{\n",
       "            background-color:  #b6e192;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row3_col10{\n",
       "            background-color:  #edf8b2;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row3_col11{\n",
       "            background-color:  #fcfed6;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row3_col12{\n",
       "            background-color:  #d6efa2;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row4_col1{\n",
       "            background-color:  #2f934d;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row4_col2{\n",
       "            background-color:  #0d733c;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_01a33_row4_col3{\n",
       "            background-color:  #42ab5d;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row4_col4{\n",
       "            background-color:  #11753d;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_01a33_row4_col5,#T_01a33_row8_col3{\n",
       "            background-color:  #45ad5f;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row4_col6,#T_01a33_row7_col1{\n",
       "            background-color:  #cfec9e;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row5_col8,#T_01a33_row10_col0{\n",
       "            background-color:  #e7f6ad;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row5_col9{\n",
       "            background-color:  #9dd688;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row5_col10{\n",
       "            background-color:  #f8fcbd;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row5_col12,#T_01a33_row13_col0{\n",
       "            background-color:  #e9f6af;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row6_col0{\n",
       "            background-color:  #00492b;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_01a33_row6_col1{\n",
       "            background-color:  #15793e;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_01a33_row6_col2{\n",
       "            background-color:  #00522e;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_01a33_row6_col3{\n",
       "            background-color:  #208242;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_01a33_row6_col4{\n",
       "            background-color:  #005530;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_01a33_row6_col5{\n",
       "            background-color:  #339951;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row6_col6{\n",
       "            background-color:  #66bd70;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row6_col8{\n",
       "            background-color:  #edf8b1;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row6_col9,#T_01a33_row6_col11{\n",
       "            background-color:  #9ad587;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row6_col12{\n",
       "            background-color:  #d9f0a3;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row7_col0{\n",
       "            background-color:  #f8fcbe;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row7_col3{\n",
       "            background-color:  #f0f9b4;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row8_col0{\n",
       "            background-color:  #c8e99b;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row8_col1{\n",
       "            background-color:  #2f944e;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row8_col6{\n",
       "            background-color:  #006636;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_01a33_row8_col7{\n",
       "            background-color:  #a4d98a;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row9_col0{\n",
       "            background-color:  #f9fdc4;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row9_col8{\n",
       "            background-color:  #daf0a4;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row10_col9{\n",
       "            background-color:  #fafdcc;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row11_col0{\n",
       "            background-color:  #8dcf81;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row11_col1{\n",
       "            background-color:  #d5eea1;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row11_col2,#T_01a33_row11_col4{\n",
       "            background-color:  #e3f4aa;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row11_col3{\n",
       "            background-color:  #e8f6ae;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row12_col0{\n",
       "            background-color:  #a7db8c;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row12_col1{\n",
       "            background-color:  #dbf1a4;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row12_col2{\n",
       "            background-color:  #1c7e40;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_01a33_row12_col3{\n",
       "            background-color:  #c7e89a;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row12_col4{\n",
       "            background-color:  #1d7f41;\n",
       "            color:  #f1f1f1;\n",
       "        }#T_01a33_row12_col5{\n",
       "            background-color:  #389f55;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row12_col9{\n",
       "            background-color:  #58b669;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row12_col10{\n",
       "            background-color:  #fbfdce;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row12_col11{\n",
       "            background-color:  #86cc7f;\n",
       "            color:  #000000;\n",
       "        }#T_01a33_row12_col12{\n",
       "            background-color:  #fdfeda;\n",
       "            color:  #000000;\n",
       "        }</style><table id=\"T_01a33_\" ><thead>    <tr>        <th class=\"blank level0\" ></th>        <th class=\"col_heading level0 col0\" >MV</th>        <th class=\"col_heading level0 col1\" >MAD</th>        <th class=\"col_heading level0 col2\" >MSV</th>        <th class=\"col_heading level0 col3\" >FLPM</th>        <th class=\"col_heading level0 col4\" >SLPM</th>        <th class=\"col_heading level0 col5\" >CVaR</th>        <th class=\"col_heading level0 col6\" >EVaR</th>        <th class=\"col_heading level0 col7\" >WR</th>        <th class=\"col_heading level0 col8\" >MDD</th>        <th class=\"col_heading level0 col9\" >ADD</th>        <th class=\"col_heading level0 col10\" >CDaR</th>        <th class=\"col_heading level0 col11\" >UCI</th>        <th class=\"col_heading level0 col12\" >EDaR</th>    </tr></thead><tbody>\n",
       "                <tr>\n",
       "                        <th id=\"T_01a33_level0_row0\" class=\"row_heading level0 row0\" >APA</th>\n",
       "                        <td id=\"T_01a33_row0_col0\" class=\"data row0 col0\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row0_col1\" class=\"data row0 col1\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row0_col2\" class=\"data row0 col2\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row0_col3\" class=\"data row0 col3\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row0_col4\" class=\"data row0 col4\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row0_col5\" class=\"data row0 col5\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row0_col6\" class=\"data row0 col6\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row0_col7\" class=\"data row0 col7\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row0_col8\" class=\"data row0 col8\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row0_col9\" class=\"data row0 col9\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row0_col10\" class=\"data row0 col10\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row0_col11\" class=\"data row0 col11\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row0_col12\" class=\"data row0 col12\" >0.00%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_01a33_level0_row1\" class=\"row_heading level0 row1\" >CMCSA</th>\n",
       "                        <td id=\"T_01a33_row1_col0\" class=\"data row1 col0\" >7.31%</td>\n",
       "                        <td id=\"T_01a33_row1_col1\" class=\"data row1 col1\" >7.34%</td>\n",
       "                        <td id=\"T_01a33_row1_col2\" class=\"data row1 col2\" >8.79%</td>\n",
       "                        <td id=\"T_01a33_row1_col3\" class=\"data row1 col3\" >6.38%</td>\n",
       "                        <td id=\"T_01a33_row1_col4\" class=\"data row1 col4\" >8.88%</td>\n",
       "                        <td id=\"T_01a33_row1_col5\" class=\"data row1 col5\" >8.36%</td>\n",
       "                        <td id=\"T_01a33_row1_col6\" class=\"data row1 col6\" >8.79%</td>\n",
       "                        <td id=\"T_01a33_row1_col7\" class=\"data row1 col7\" >5.47%</td>\n",
       "                        <td id=\"T_01a33_row1_col8\" class=\"data row1 col8\" >6.11%</td>\n",
       "                        <td id=\"T_01a33_row1_col9\" class=\"data row1 col9\" >15.07%</td>\n",
       "                        <td id=\"T_01a33_row1_col10\" class=\"data row1 col10\" >5.27%</td>\n",
       "                        <td id=\"T_01a33_row1_col11\" class=\"data row1 col11\" >11.85%</td>\n",
       "                        <td id=\"T_01a33_row1_col12\" class=\"data row1 col12\" >7.29%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_01a33_level0_row2\" class=\"row_heading level0 row2\" >CNP</th>\n",
       "                        <td id=\"T_01a33_row2_col0\" class=\"data row2 col0\" >1.67%</td>\n",
       "                        <td id=\"T_01a33_row2_col1\" class=\"data row2 col1\" >3.53%</td>\n",
       "                        <td id=\"T_01a33_row2_col2\" class=\"data row2 col2\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row2_col3\" class=\"data row2 col3\" >2.67%</td>\n",
       "                        <td id=\"T_01a33_row2_col4\" class=\"data row2 col4\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row2_col5\" class=\"data row2 col5\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row2_col6\" class=\"data row2 col6\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row2_col7\" class=\"data row2 col7\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row2_col8\" class=\"data row2 col8\" >18.42%</td>\n",
       "                        <td id=\"T_01a33_row2_col9\" class=\"data row2 col9\" >4.20%</td>\n",
       "                        <td id=\"T_01a33_row2_col10\" class=\"data row2 col10\" >25.33%</td>\n",
       "                        <td id=\"T_01a33_row2_col11\" class=\"data row2 col11\" >10.06%</td>\n",
       "                        <td id=\"T_01a33_row2_col12\" class=\"data row2 col12\" >20.55%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_01a33_level0_row3\" class=\"row_heading level0 row3\" >HPQ</th>\n",
       "                        <td id=\"T_01a33_row3_col0\" class=\"data row3 col0\" >21.28%</td>\n",
       "                        <td id=\"T_01a33_row3_col1\" class=\"data row3 col1\" >22.38%</td>\n",
       "                        <td id=\"T_01a33_row3_col2\" class=\"data row3 col2\" >19.00%</td>\n",
       "                        <td id=\"T_01a33_row3_col3\" class=\"data row3 col3\" >24.95%</td>\n",
       "                        <td id=\"T_01a33_row3_col4\" class=\"data row3 col4\" >18.78%</td>\n",
       "                        <td id=\"T_01a33_row3_col5\" class=\"data row3 col5\" >16.58%</td>\n",
       "                        <td id=\"T_01a33_row3_col6\" class=\"data row3 col6\" >15.88%</td>\n",
       "                        <td id=\"T_01a33_row3_col7\" class=\"data row3 col7\" >14.88%</td>\n",
       "                        <td id=\"T_01a33_row3_col8\" class=\"data row3 col8\" >13.48%</td>\n",
       "                        <td id=\"T_01a33_row3_col9\" class=\"data row3 col9\" >3.41%</td>\n",
       "                        <td id=\"T_01a33_row3_col10\" class=\"data row3 col10\" >6.93%</td>\n",
       "                        <td id=\"T_01a33_row3_col11\" class=\"data row3 col11\" >1.57%</td>\n",
       "                        <td id=\"T_01a33_row3_col12\" class=\"data row3 col12\" >10.91%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_01a33_level0_row4\" class=\"row_heading level0 row4\" >PSA</th>\n",
       "                        <td id=\"T_01a33_row4_col0\" class=\"data row4 col0\" >12.08%</td>\n",
       "                        <td id=\"T_01a33_row4_col1\" class=\"data row4 col1\" >15.68%</td>\n",
       "                        <td id=\"T_01a33_row4_col2\" class=\"data row4 col2\" >15.84%</td>\n",
       "                        <td id=\"T_01a33_row4_col3\" class=\"data row4 col3\" >15.57%</td>\n",
       "                        <td id=\"T_01a33_row4_col4\" class=\"data row4 col4\" >15.77%</td>\n",
       "                        <td id=\"T_01a33_row4_col5\" class=\"data row4 col5\" >15.63%</td>\n",
       "                        <td id=\"T_01a33_row4_col6\" class=\"data row4 col6\" >7.81%</td>\n",
       "                        <td id=\"T_01a33_row4_col7\" class=\"data row4 col7\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row4_col8\" class=\"data row4 col8\" >38.43%</td>\n",
       "                        <td id=\"T_01a33_row4_col9\" class=\"data row4 col9\" >31.22%</td>\n",
       "                        <td id=\"T_01a33_row4_col10\" class=\"data row4 col10\" >41.50%</td>\n",
       "                        <td id=\"T_01a33_row4_col11\" class=\"data row4 col11\" >34.67%</td>\n",
       "                        <td id=\"T_01a33_row4_col12\" class=\"data row4 col12\" >41.70%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_01a33_level0_row5\" class=\"row_heading level0 row5\" >SEE</th>\n",
       "                        <td id=\"T_01a33_row5_col0\" class=\"data row5 col0\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row5_col1\" class=\"data row5 col1\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row5_col2\" class=\"data row5 col2\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row5_col3\" class=\"data row5 col3\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row5_col4\" class=\"data row5 col4\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row5_col5\" class=\"data row5 col5\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row5_col6\" class=\"data row5 col6\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row5_col7\" class=\"data row5 col7\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row5_col8\" class=\"data row5 col8\" >7.49%</td>\n",
       "                        <td id=\"T_01a33_row5_col9\" class=\"data row5 col9\" >12.88%</td>\n",
       "                        <td id=\"T_01a33_row5_col10\" class=\"data row5 col10\" >4.78%</td>\n",
       "                        <td id=\"T_01a33_row5_col11\" class=\"data row5 col11\" >11.08%</td>\n",
       "                        <td id=\"T_01a33_row5_col12\" class=\"data row5 col12\" >7.66%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_01a33_level0_row6\" class=\"row_heading level0 row6\" >ZION</th>\n",
       "                        <td id=\"T_01a33_row6_col0\" class=\"data row6 col0\" >20.91%</td>\n",
       "                        <td id=\"T_01a33_row6_col1\" class=\"data row6 col1\" >17.88%</td>\n",
       "                        <td id=\"T_01a33_row6_col2\" class=\"data row6 col2\" >18.28%</td>\n",
       "                        <td id=\"T_01a33_row6_col3\" class=\"data row6 col3\" >18.92%</td>\n",
       "                        <td id=\"T_01a33_row6_col4\" class=\"data row6 col4\" >18.22%</td>\n",
       "                        <td id=\"T_01a33_row6_col5\" class=\"data row6 col5\" >17.27%</td>\n",
       "                        <td id=\"T_01a33_row6_col6\" class=\"data row6 col6\" >15.12%</td>\n",
       "                        <td id=\"T_01a33_row6_col7\" class=\"data row6 col7\" >14.63%</td>\n",
       "                        <td id=\"T_01a33_row6_col8\" class=\"data row6 col8\" >6.48%</td>\n",
       "                        <td id=\"T_01a33_row6_col9\" class=\"data row6 col9\" >13.10%</td>\n",
       "                        <td id=\"T_01a33_row6_col10\" class=\"data row6 col10\" >13.29%</td>\n",
       "                        <td id=\"T_01a33_row6_col11\" class=\"data row6 col11\" >14.57%</td>\n",
       "                        <td id=\"T_01a33_row6_col12\" class=\"data row6 col12\" >10.48%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_01a33_level0_row7\" class=\"row_heading level0 row7\" >PEP11900D031</th>\n",
       "                        <td id=\"T_01a33_row7_col0\" class=\"data row7 col0\" >2.34%</td>\n",
       "                        <td id=\"T_01a33_row7_col1\" class=\"data row7 col1\" >6.29%</td>\n",
       "                        <td id=\"T_01a33_row7_col2\" class=\"data row7 col2\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row7_col3\" class=\"data row7 col3\" >3.83%</td>\n",
       "                        <td id=\"T_01a33_row7_col4\" class=\"data row7 col4\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row7_col5\" class=\"data row7 col5\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row7_col6\" class=\"data row7 col6\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row7_col7\" class=\"data row7 col7\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row7_col8\" class=\"data row7 col8\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row7_col9\" class=\"data row7 col9\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row7_col10\" class=\"data row7 col10\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row7_col11\" class=\"data row7 col11\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row7_col12\" class=\"data row7 col12\" >0.00%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_01a33_level0_row8\" class=\"row_heading level0 row8\" >PEP13000D012</th>\n",
       "                        <td id=\"T_01a33_row8_col0\" class=\"data row8 col0\" >6.36%</td>\n",
       "                        <td id=\"T_01a33_row8_col1\" class=\"data row8 col1\" >15.62%</td>\n",
       "                        <td id=\"T_01a33_row8_col2\" class=\"data row8 col2\" >19.18%</td>\n",
       "                        <td id=\"T_01a33_row8_col3\" class=\"data row8 col3\" >15.37%</td>\n",
       "                        <td id=\"T_01a33_row8_col4\" class=\"data row8 col4\" >19.39%</td>\n",
       "                        <td id=\"T_01a33_row8_col5\" class=\"data row8 col5\" >25.39%</td>\n",
       "                        <td id=\"T_01a33_row8_col6\" class=\"data row8 col6\" >24.55%</td>\n",
       "                        <td id=\"T_01a33_row8_col7\" class=\"data row8 col7\" >18.52%</td>\n",
       "                        <td id=\"T_01a33_row8_col8\" class=\"data row8 col8\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row8_col9\" class=\"data row8 col9\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row8_col10\" class=\"data row8 col10\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row8_col11\" class=\"data row8 col11\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row8_col12\" class=\"data row8 col12\" >0.00%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_01a33_level0_row9\" class=\"row_heading level0 row9\" >PEP13000M088</th>\n",
       "                        <td id=\"T_01a33_row9_col0\" class=\"data row9 col0\" >2.03%</td>\n",
       "                        <td id=\"T_01a33_row9_col1\" class=\"data row9 col1\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row9_col2\" class=\"data row9 col2\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row9_col3\" class=\"data row9 col3\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row9_col4\" class=\"data row9 col4\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row9_col5\" class=\"data row9 col5\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row9_col6\" class=\"data row9 col6\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row9_col7\" class=\"data row9 col7\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row9_col8\" class=\"data row9 col8\" >9.59%</td>\n",
       "                        <td id=\"T_01a33_row9_col9\" class=\"data row9 col9\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row9_col10\" class=\"data row9 col10\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row9_col11\" class=\"data row9 col11\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row9_col12\" class=\"data row9 col12\" >0.00%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_01a33_level0_row10\" class=\"row_heading level0 row10\" >PEP23900M103</th>\n",
       "                        <td id=\"T_01a33_row10_col0\" class=\"data row10 col0\" >4.15%</td>\n",
       "                        <td id=\"T_01a33_row10_col1\" class=\"data row10 col1\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row10_col2\" class=\"data row10 col2\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row10_col3\" class=\"data row10 col3\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row10_col4\" class=\"data row10 col4\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row10_col5\" class=\"data row10 col5\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row10_col6\" class=\"data row10 col6\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row10_col7\" class=\"data row10 col7\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row10_col8\" class=\"data row10 col8\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row10_col9\" class=\"data row10 col9\" >2.27%</td>\n",
       "                        <td id=\"T_01a33_row10_col10\" class=\"data row10 col10\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row10_col11\" class=\"data row10 col11\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row10_col12\" class=\"data row10 col12\" >0.00%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_01a33_level0_row11\" class=\"row_heading level0 row11\" >PEP70101M530</th>\n",
       "                        <td id=\"T_01a33_row11_col0\" class=\"data row11 col0\" >9.62%</td>\n",
       "                        <td id=\"T_01a33_row11_col1\" class=\"data row11 col1\" >5.86%</td>\n",
       "                        <td id=\"T_01a33_row11_col2\" class=\"data row11 col2\" >4.04%</td>\n",
       "                        <td id=\"T_01a33_row11_col3\" class=\"data row11 col3\" >4.75%</td>\n",
       "                        <td id=\"T_01a33_row11_col4\" class=\"data row11 col4\" >4.03%</td>\n",
       "                        <td id=\"T_01a33_row11_col5\" class=\"data row11 col5\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row11_col6\" class=\"data row11 col6\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row11_col7\" class=\"data row11 col7\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row11_col8\" class=\"data row11 col8\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row11_col9\" class=\"data row11 col9\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row11_col10\" class=\"data row11 col10\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row11_col11\" class=\"data row11 col11\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row11_col12\" class=\"data row11 col12\" >0.00%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_01a33_level0_row12\" class=\"row_heading level0 row12\" >PEP70101M571</th>\n",
       "                        <td id=\"T_01a33_row12_col0\" class=\"data row12 col0\" >8.27%</td>\n",
       "                        <td id=\"T_01a33_row12_col1\" class=\"data row12 col1\" >5.43%</td>\n",
       "                        <td id=\"T_01a33_row12_col2\" class=\"data row12 col2\" >14.87%</td>\n",
       "                        <td id=\"T_01a33_row12_col3\" class=\"data row12 col3\" >7.56%</td>\n",
       "                        <td id=\"T_01a33_row12_col4\" class=\"data row12 col4\" >14.93%</td>\n",
       "                        <td id=\"T_01a33_row12_col5\" class=\"data row12 col5\" >16.77%</td>\n",
       "                        <td id=\"T_01a33_row12_col6\" class=\"data row12 col6\" >27.86%</td>\n",
       "                        <td id=\"T_01a33_row12_col7\" class=\"data row12 col7\" >46.51%</td>\n",
       "                        <td id=\"T_01a33_row12_col8\" class=\"data row12 col8\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row12_col9\" class=\"data row12 col9\" >17.84%</td>\n",
       "                        <td id=\"T_01a33_row12_col10\" class=\"data row12 col10\" >2.90%</td>\n",
       "                        <td id=\"T_01a33_row12_col11\" class=\"data row12 col11\" >16.20%</td>\n",
       "                        <td id=\"T_01a33_row12_col12\" class=\"data row12 col12\" >1.42%</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_01a33_level0_row13\" class=\"row_heading level0 row13\" >PEP70310M156</th>\n",
       "                        <td id=\"T_01a33_row13_col0\" class=\"data row13 col0\" >3.98%</td>\n",
       "                        <td id=\"T_01a33_row13_col1\" class=\"data row13 col1\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row13_col2\" class=\"data row13 col2\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row13_col3\" class=\"data row13 col3\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row13_col4\" class=\"data row13 col4\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row13_col5\" class=\"data row13 col5\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row13_col6\" class=\"data row13 col6\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row13_col7\" class=\"data row13 col7\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row13_col8\" class=\"data row13 col8\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row13_col9\" class=\"data row13 col9\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row13_col10\" class=\"data row13 col10\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row13_col11\" class=\"data row13 col11\" >0.00%</td>\n",
       "                        <td id=\"T_01a33_row13_col12\" class=\"data row13 col12\" >0.00%</td>\n",
       "            </tr>\n",
       "    </tbody></table>"
      ],
      "text/plain": [
       "<pandas.io.formats.style.Styler at 0x7f8d0eb2fa30>"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "w_s.style.format(\"{:.2%}\").background_gradient(cmap='YlGn')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:>"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAz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3//+97n99tvrGqeFjCRJkiQAFi5cyFprrcV2220HwJw5c3j3u9/NvHnz3tHr/fu//zt/+ctf6NOnTz3DBCxkJEmSJNW88sornHrqqbz44ousvfbavPe972XatGl89KMf5R/+4R/o27cvAHvuuSennHLKal9vr7326rJYLWQkSZKkHmp12yXX2y677NLhFLDZs2d3eP6ECRM6bOuoferUqWsWXDsu9pckSZJUORYykiRJkirHQkaSJElS5VjISJIkSaocCxlJkiRJlWMhI0mSJKlyLGQkSZIktXj66aeZOHEiw4YNY8cdd+Tggw8mIli4cGGb80477TS+853vrPR1hgwZwqhRoxg9ejTvf//7efzxx+sap/eRkSRJknqo7x1zSF1f74szrl1lf2ZyxBFHcMIJJ9DU1ATAnDlzWLJkCU1NTZx11lkALF++nJ/+9Kf89re/XeXrzZo1i80224yzzjqLr3/961x00UX1SQRHZCRJkiTVzJo1i759+3LyySe3tI0dO5bvf//7LYUNwK233sqQIUN497vfzeGHH84uu+zCyJEjmTZtWoevu+eee/Lkk0/WNVZHZCRJkiQBMG/ePHbZZZcV2kePHs1aa63Fgw8+yJgxY2hqamLSpEkA/OhHP2LTTTdlyZIl7Lrrrhx11FEMGDCgzfNvuOEGDj/88LrG6oiMJEmSpNWaNGkSTU1NLFu2jKuvvpqPfexjAJx33nmMGTOGPfbYgyeeeIKHH3645Tn77bcfm2++OTfddBPHHntsXeOxkJEkSZIEwMiRI7nvvvs67Js0aRKXX345N910E6NHj2bzzTdn9uzZ3HTTTdxxxx08+OCDjBs3jqVLl7Y8Z9asWTz++OOMHDmSM888s66xWshIkiRJAmD//ffntddea7Mo/5577uGWW25h2LBhDBgwgClTprRMK3vppZd417vexfrrr8+CBQu48847V3jNfv36ce6553LZZZfx/PPP1y1WCxlJkiRJAEQEV111FTfeeCPDhg1j5MiRTJ06la233hooRmUWLFjAEUccAcCBBx7IsmXLGD16NF/5ylfYY489OnzdrbbaikmTJnHBBRfULVYX+0uSJEk91Oq2S+4KW2+9NZdffnmHfaeffjqnn356y/G6667LL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AEAs2bN4sgjj2TWrFmMGDECgP/4j//gox/9KJnJueeey3777ce8efNYZ5116pZLZ6aWSZIkSepFDjroIK677joApk+fzqRJk1Z67n777cdJJ53EtGnTVuiLCE4//XS23HJLfvnLX9Y1RgsZSZIkSW1MnDiRpqYmli5dykMPPcTuu+++yvN33nlnFixY8I773wkLGUmSJEltjB49mkWLFjF9+nQOPvjg1Z6/uuXxXbF83kJGkiRJ0goOPfRQJk+evMppZc0eeOCBlvUx76T/nejUYn9JkiRJvcsnPvEJ+vfvz6hRo5g9e/ZKz7vllluYNm0as2bNWqEvMzn//PN56qmnOPDAA+san4WMJEmSpBUMGjSIL3zhCx32zZgxg9/85je8+uqrDB06lCuvvLLNiMu//Mu/8LWvfY1XX32VPfbYg1mzZtV1xzKwkJEkSZJ6rM5sl1xvr7zyygptEyZMYMKECUBxn5gTTzxxpc+/5JJLuiawdlwjI0mSJKlyLGQkSZIkVY5TyyRJkqQ6WTzltuLBeuXG0Rs4IiNJkiSpcixkJEmSJFWOhYwkSZKkyrGQkSRJktTGVVddRUSwYMECABYtWkS/fv0YN24cI0aMYLfdduPSSy9tOf+SSy5h4MCBjBs3ju22244DDjiA22+/vUtjdLG/JEmS1ENtOWtOXV/v6f3Gduq86dOns88++9DU1MTUqVMBGDZsGA888AAAjz32GEceeSTLly/nH//xHwE45phj+MEPfgDArFmzOPLII5k1a1abG2XWkyMykiRJklq88sor/Pa3v+Xiiy+mqampw3Pe8573cM4553Deeed12L/ffvtx0kknMW3atC6L00JGkiRJUouf//znHHjggWy//fZsuumm3H///R2et/POO7dMPXsn/WvKQkaSJElSi+nTpzNx4kQAJk6cyPTp0zs8LzNX+Tqr619TrpGRJEmSBMBzzz3HzJkzmTdvHhHBm2++SUTw2c9+doVzH3jggVWuf1ld/5pyREaSJEkSAD/96U85/vjjefzxx1m0aBFPPPEEQ4cOZfHixW3OW7RoEZMnT+bUU0/t8HVuueUWpk2bxqc//ekui9URGUmSJElAMa1sypQpbdqOOuoovvnNb/Loo48ybtw4li5dykYbbcSpp57asmMZwIwZM/jNb37Dq6++ytChQ7nyyiu7dETGQkaSJEnqoTq7XXK9zJ49e4W2z3/+83z+859f5fNOPPFETjzxxK4JaiWcWiZJkiSpcixkJEmSJFWOhYwkSZKkyrGQkSSpQXzvmEP43jGHlB2GJHULCxlV3pAp1zFkynVlhyFJkqRuZCEjSZIkqXIsZKRuMH/4COYP77p91CVJkurl6aefZuLEiQwbNowdd9yRgw8+mD/84Q/069ePcePGMWLECHbbbTcuvfTS1b7W7Nmz6d+/P+PGjWP48OFMnjy5bnF6HxlJkiSph6r39PlFZ//DKvszkyOOOIITTjiBpqYmAObMmcMzzzzDsGHDeOCBBwB47LHHOPLII1m+fHmbm2J2ZN999+Xaa69lyZIljBs3jiOOOIK99957jXNxREaSJEkSALNmzaJv376cfPLJLW1jx45l2223bXPee97zHs455xzOO+88AO6++2722msvxo0bx1577cXChQtXeO1+/foxduxYnnzyybrE6oiMJEkNZvGU21oeDzp73xIjkVQ18+bNY5dddunUuTvvvDMLFiwAYPjw4dx6662svfba3HTTTXz5y1/myiuvbHP+Cy+8wMMPP8z73ve+usRqISNJkiTpbcvMlscvvfQSJ5xwAg8//DARwRtvvNHSd9tttzF69GgWLlzIlClT2HLLLevy/Z1aJkmSJAmAkSNHct9993Xq3AceeIARI4rNjL7yla+w3377MW/ePH7xi1+wdOnSlvP23XdfHnroIebOncsPf/hD5syZU5dYLWQkSZIkAbD//vvz2muvcdFFF7W03XPPPTz++ONtzlu0aBGTJ0/m1FNPBYoRmW222QaASy65pMPX3n777TnjjDP49re/XZdYLWQkSZIkARARXHXVVdx4440MGzaMkSNHMnXqVLbeemseffTRlu2Xjz76aE499dSWHcu+9KUvccYZZ7D33nvz5ptvrvT1Tz75ZG699Vb++Mc/rnGsrpGRJEmSeqjVbZfcFbbeemsuv/zyFdqXLFmy0ufsueee/OEPf2g5/trXvgbAhAkTmDBhQkt7v3796rZrmSMykiRJkirHQkaSJElS5VjISJIkSaocCxlJki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dkJElSjxYRs6ltAduBzMxKF2rmZ349WU/Oz0JGktQrRMSXMvM7tccfy8wrWvV9MzO/XF50a6aRc5OklXHXMklSbzGx1eMz2vUd2J2BdIFGzo2I+FKrxx9r1/fN7o+ovsyv2syvPBYykqTeIlbyuKPjqmnk3KDBCzXMr+rMryQWMpKk3iJX8rij46pp5Nyg8Qs186s28yuJu5ZJknqLMRHxN4o/vP1qj6kdr1deWHXRyLlB4xdq5ldt5lcSF/tLkqQeLSLeBP5OrVADXm3uAtbLzL5lxVYP5md+PVlPzs9CRpLUK0TEesDJwHuBh4AfZeaycqOqj0bOTZJWxkJGktQrRMQM4A3gNuAg4PHM/EK5UdVHI+cGjV+omV+1mV95LGQkSb1CRMzNzFG1x2sDd2fmziWHVReNnBv0ikLN/CrM/MrjYn9JUm/xRvODzFwW0QibCbVo5NwAdmxVqF0M3F1yPPVmftVmfiWxkJEk9RZj2u3m1by7VwCZmRuXF9oaa+TcoPELNfOrNvMriVPLJElSj9Zq1yRou3NSQxRq5md+PVlPzs9CRpIkSVLlrFV2AJIkSZL0dlnISJIkSaocCxlJkiRJlWMhI0mSJKlyLGQkSZIkVc7/D5pJ/EiFf/MlAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 1008x432 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "\n",
    "# Plotting a comparison of assets weights for each portfolio\n",
    "\n",
    "fig = plt.gcf()\n",
    "fig.set_figwidth(14)\n",
    "fig.set_figheight(6)\n",
    "ax = fig.subplots(nrows=1, ncols=1)\n",
    "\n",
    "w_s.plot.bar(ax=ax)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can see that in the studied cases, the Augmented Black Litterman model increase the diversification in higher degree than Bayesian Black Litterman model."
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
